diff options
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r-- | src/utils/xml.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 1970b062..65eb1370 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -21,15 +21,20 @@ #include "utils/xml.h" +#include <iostream> +#include <fstream> +#include <cstring> + +#include <libxml/parser.h> +#include <libxml/xmlerror.h> + #include "log.h" #include "resources/resourcemanager.h" +#include "utils/stringutils.h" #include "utils/zlib.h" -#include <libxml/parser.h> -#include <libxml/xmlerror.h> - namespace XML { static void xmlLogger(void *ctx, xmlErrorPtr error); @@ -129,6 +134,18 @@ namespace XML return def; } + bool getBoolProperty(xmlNodePtr node, const char* name, bool def) + { + bool ret = def; + xmlChar *prop = xmlGetProp(node, BAD_CAST name); + if (prop) + { + ret = getBoolFromString((char*) prop, def); + xmlFree(prop); + } + return ret; + } + xmlNodePtr findFirstChildByName(xmlNodePtr parent, const char *name) { for_each_xml_child_node(child, parent) |