3 {
5 std::vector<uint8> xmlstr;
9 if(!res){
10 printf("Received message in incorrect format.\n");
11 return res;
12 };
13 if(xmlstr[xmlstr.size()-1] != 0){
14 xmlstr.resize(xmlstr.size()+1);
15 xmlstr[xmlstr.size()-1] = 0;
16 };
17
18
19
21
22
24 printf("Message Parsing failed. Col %d, row %d, in:\n%s\n Description: %s\n",
26 return false;
27 };
29 if(!rootnode){
30 printf("Root node not found.\n");
31 return false;
32 };
33 if(rootnode->ValueStr() != PAVPROT_NODE_ROOT){
34 printf("Wrong root node, got \"%s\".\n", rootnode->ValueStr().c_str());
35 return false;
36 };
39 printf("Message node not found.\n");
40 return false;
41 };
43 if(
m_messNode->ValueStr() != PAVPROT_NODE_MESS){
44 printf(
"Wrong message node, got \"%s\".\n",
m_messNode->ValueStr().c_str());
45 return false;
46 };
47
48 int errid;
50 printf(
"Server response of an error, code=%d (%s).\n", errid,
GetErrorStr(errid).c_str());
52 if(errstr)
53 printf("\tStatus:\"%s\"\n", errstr);
54 }else{
56 if(msg)
57 printf(">>Got message from server: \"%s\"\n", msg);
58 };
61
62 return res;
63};
TiXmlElement * m_messNode
Definition: MessageReader.h:43
int m_messId
Definition: MessageReader.h:45
std::string GetErrorStr(int err_)
Definition: MessageReader.cpp:256
TiXmlDocument m_xmlDoc
Definition: MessageReader.h:39
virtual bool ReadMessage(uint8 *buf_, uint32 size_, std::vector< uint8 > &dstbuf_)
Definition: PAVProtocol.cpp:75
const char * ErrorDesc() const
Contains a textual (english) description of the error if one occurs.
Definition: tinyxml.h:1463
int ErrorRow() const
Definition: tinyxml.h:1477
bool Error() const
Definition: tinyxml.h:1460
virtual const char * Parse(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Definition: tinyxmlparser.cpp:704
int ErrorCol() const
The column where the error occured. See ErrorRow()
Definition: tinyxml.h:1478
Definition: tinyxml.h:941
int QueryIntAttribute(const char *name, int *_value) const
Definition: tinyxml.cpp:661
const char * GetText() const
Definition: tinyxml.cpp:900
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
Definition: tinyxml.cpp:452
void Clear()
Delete all the children of this node. Does not affect 'this'.
Definition: tinyxml.cpp:169
@ TIXML_SUCCESS
Definition: tinyxml.h:156