28 const std::string &title)
30 if (tinyxml2::XMLDocument::Parse(
str.c_str()))
35 static std::string
to_string(
const tinyxml2::XMLDocument &doc)
37 tinyxml2::XMLPrinter printer;
39 return printer.CStr();
44 std::string
ret = doc.ErrorName();
45 const char *es = doc.ErrorStr();
54 template <
typename T,
typename... Args>
55 static std::string
find_text(
const tinyxml2::XMLNode *node,
59 const tinyxml2::XMLElement *e =
find(node, first, args...);
66 template <
typename T,
typename... Args>
67 static const tinyxml2::XMLElement *
find(
const tinyxml2::XMLNode *node,
71 const tinyxml2::XMLElement *e =
find(node, first);
77 static const tinyxml2::XMLElement *
find(
const tinyxml2::XMLNode *node,
78 const std::string &first)
80 return node->FirstChildElement(first.c_str());
83 static const tinyxml2::XMLElement *
find(
const tinyxml2::XMLNode *node,
86 return node->FirstChildElement(first);
89 static const tinyxml2::XMLElement *
find(
const tinyxml2::XMLElement *elem)
94 static const tinyxml2::XMLElement *
next_sibling(
const tinyxml2::XMLNode *node,
95 const std::string &name)
97 return node->NextSiblingElement(name.c_str());
100 static const tinyxml2::XMLElement *
next_sibling(
const tinyxml2::XMLNode *node,
103 return node->NextSiblingElement(name);
106 static const tinyxml2::XMLElement *
next_sibling(
const tinyxml2::XMLNode *node)
108 return node->NextSiblingElement();
static std::string format_error(const tinyxml2::XMLDocument &doc)
static const tinyxml2::XMLElement * find(const tinyxml2::XMLNode *node, const char *first)
OPENVPN_EXCEPTION(xml_parse)
static const tinyxml2::XMLElement * next_sibling(const tinyxml2::XMLNode *node, const char *name)
static const tinyxml2::XMLElement * find(const tinyxml2::XMLNode *node, const T &first, Args... args)
static const tinyxml2::XMLElement * next_sibling(const tinyxml2::XMLNode *node)
static const tinyxml2::XMLElement * find(const tinyxml2::XMLElement *elem)
static const tinyxml2::XMLElement * next_sibling(const tinyxml2::XMLNode *node, const std::string &name)
static std::string find_text(const tinyxml2::XMLNode *node, const T &first, Args... args)
static std::string to_string(const tinyxml2::XMLDocument &doc)
static const tinyxml2::XMLElement * find(const tinyxml2::XMLNode *node, const std::string &first)
#define OPENVPN_THROW(exc, stuff)
Document(const std::string &str, const std::string &title)
os<< "Session Name: "<< tbc-> session_name<< '\n';os<< "Layer: "<< tbc-> layer str()<< '\n'