From 793a119a7a36f9680dad108e75075c8c4bd4a0d0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Jan 2012 18:58:54 +0300 Subject: Replace all xmlNodePtr to XmlNodePtr. --- src/utils/xml.cpp | 12 ++++++------ src/utils/xml.h | 24 +++++++++++++----------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'src/utils') diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 5a9558cc2..d1df63510 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -101,12 +101,12 @@ namespace XML xmlFreeDoc(mDoc); } - xmlNodePtr Document::rootNode() + XmlNodePtr Document::rootNode() { return mDoc ? xmlDocGetRootElement(mDoc) : nullptr; } - int getProperty(xmlNodePtr node, const char* name, int def) + int getProperty(XmlNodePtr node, const char* name, int def) { int &ret = def; @@ -120,7 +120,7 @@ namespace XML return ret; } - double getFloatProperty(xmlNodePtr node, const char* name, double def) + double getFloatProperty(XmlNodePtr node, const char* name, double def) { double &ret = def; @@ -134,7 +134,7 @@ namespace XML return ret; } - std::string getProperty(xmlNodePtr node, const char *name, + std::string getProperty(XmlNodePtr node, const char *name, const std::string &def) { xmlChar *prop = xmlGetProp(node, BAD_CAST name); @@ -148,7 +148,7 @@ namespace XML return def; } - bool getBoolProperty(xmlNodePtr node, const char* name, bool def) + bool getBoolProperty(XmlNodePtr node, const char* name, bool def) { xmlChar *prop = xmlGetProp(node, BAD_CAST name); @@ -159,7 +159,7 @@ namespace XML return def; } - xmlNodePtr findFirstChildByName(xmlNodePtr parent, const char *name) + XmlNodePtr findFirstChildByName(XmlNodePtr parent, const char *name) { for_each_xml_child_node(child, parent) { diff --git a/src/utils/xml.h b/src/utils/xml.h index 2b97b45f5..849bc2060 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -29,6 +29,8 @@ #include +#define XmlNodePtr xmlNodePtr + /** * XML helper functions. */ @@ -65,42 +67,42 @@ namespace XML * Returns the root node of the document (or NULL if there was a * load error). */ - xmlNodePtr rootNode(); + XmlNodePtr rootNode(); private: xmlDocPtr mDoc; }; /** - * Gets an floating point property from an xmlNodePtr. + * Gets an floating point property from an XmlNodePtr. */ - double getFloatProperty(xmlNodePtr node, const char *name, double def); + double getFloatProperty(XmlNodePtr node, const char *name, double def); /** - * Gets an integer property from an xmlNodePtr. + * Gets an integer property from an XmlNodePtr. */ - int getProperty(xmlNodePtr node, const char *name, int def); + int getProperty(XmlNodePtr node, const char *name, int def); /** - * Gets a string property from an xmlNodePtr. + * Gets a string property from an XmlNodePtr. */ - std::string getProperty(xmlNodePtr node, const char *name, + std::string getProperty(XmlNodePtr node, const char *name, const std::string &def); /** - * Gets a boolean property from an xmlNodePtr. + * Gets a boolean property from an XmlNodePtr. */ - bool getBoolProperty(xmlNodePtr node, const char *name, bool def); + bool getBoolProperty(XmlNodePtr node, const char *name, bool def); /** * Finds the first child node with the given name */ - xmlNodePtr findFirstChildByName(xmlNodePtr parent, const char *name); + XmlNodePtr findFirstChildByName(XmlNodePtr parent, const char *name); void initXML(); } #define for_each_xml_child_node(var, parent) \ - for (xmlNodePtr var = parent->xmlChildrenNode; var; var = var->next) + for (XmlNodePtr var = parent->xmlChildrenNode; var; var = var->next) #endif // XML_H -- cgit v1.2.3-70-g09d2