-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathXML.h
42 lines (34 loc) · 1.14 KB
/
XML.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* XML.h
*
* Created on: 01/sep/2014
* Author: Stefano Ceccherini
*/
#ifndef XML_H_
#define XML_H_
#include <string>
namespace tinyxml2 {
class XMLDocument;
class XMLElement;
class XMLNode;
};
class XML {
public:
enum match_mode {
match_partial = 0,
match_full = 1
};
static std::string ToString(const tinyxml2::XMLDocument& document);
static bool Serialize(const tinyxml2::XMLDocument& document, char*& destination, size_t& destLength);
static bool Deserialize(const char* source, size_t sourceLen, tinyxml2::XMLDocument& document);
static std::string GetElementText(const tinyxml2::XMLNode& node, const std::string& elementName);
static std::string GetFirstChildElementText(const tinyxml2::XMLElement*, const std::string& elementName);
static const tinyxml2::XMLElement* GetElementByName(const tinyxml2::XMLNode& node,
std::string elementName,
int matchMode = XML::match_full);
static const tinyxml2::XMLElement* GetElementByAttribute(const tinyxml2::XMLNode& node,
std::string attributeName,
std::string attributeValue,
int matchMode = XML::match_full);
};
#endif /* XML_H_ */