summaryrefslogtreecommitdiff
path: root/src/utils/xml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r--src/utils/xml.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index 341f34c0..94e0e38d 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -27,6 +27,7 @@
#include <iostream>
#include <fstream>
+#include <cstring>
namespace XML
{
@@ -135,6 +136,15 @@ namespace XML
return def;
}
+ bool getBoolProperty(xmlNodePtr node, const char* name, bool def)
+ {
+ xmlChar *prop = xmlGetProp(node, BAD_CAST name);
+
+ if (xmlStrEqual(prop, BAD_CAST "true" ) ) return true;
+ if (xmlStrEqual(prop, BAD_CAST "false") ) return false;
+ return def;
+ }
+
xmlNodePtr findFirstChildByName(xmlNodePtr parent, const char *name)
{
for_each_xml_child_node(child, parent)