From 3a407bb6b73a186eafd99bcec570f88097c4b2e1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 4 Sep 2012 19:11:53 +0300 Subject: Add const to more classes. --- src/utils/xml.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/utils/xml.h') diff --git a/src/utils/xml.h b/src/utils/xml.h index c5f217c78..cef1ebae2 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -50,7 +50,7 @@ namespace XML * Constructor that attempts to load the given file through the * resource manager. Logs errors. */ - Document(const std::string &filename, bool useResman = true); + Document(const std::string &filename, const bool useResman = true); /** * Constructor that attempts to load an XML document from memory. @@ -59,7 +59,7 @@ namespace XML * @param data the string to parse as XML * @param size the length of the string in bytes */ - Document(const char *data, int size); + Document(const char *const data, const int size); /** * Destructor. Frees the loaded XML file. @@ -79,40 +79,43 @@ namespace XML /** * Gets an floating point property from an XmlNodePtr. */ - double getFloatProperty(XmlNodePtr node, const char *name, double def); + double getFloatProperty(const XmlNodePtr node, const char *const name, + double def); /** * Gets an integer property from an XmlNodePtr. */ - int getProperty(XmlNodePtr node, const char *name, int def); + int getProperty(const XmlNodePtr node, const char *const name, int def); /** * Gets an integer property from an XmlNodePtr. */ - int getIntProperty(XmlNodePtr node, const char* name, int def, - int min, int max); + int getIntProperty(const XmlNodePtr node, const char *const name, int def, + const int min, const int max); /** * Gets a string property from an XmlNodePtr. */ - std::string getProperty(XmlNodePtr node, const char *name, + std::string getProperty(const XmlNodePtr node, const char *const name, const std::string &def); /** * Gets a translated string property from an XmlNodePtr. */ - std::string langProperty(XmlNodePtr node, const char *name, + std::string langProperty(const XmlNodePtr node, const char *const name, const std::string &def); /** * Gets a boolean property from an XmlNodePtr. */ - bool getBoolProperty(XmlNodePtr node, const char *name, bool def); + bool getBoolProperty(const XmlNodePtr node, const char *const name, + const bool def); /** * Finds the first child node with the given name */ - XmlNodePtr findFirstChildByName(XmlNodePtr parent, const char *name); + XmlNodePtr findFirstChildByName(const XmlNodePtr parent, + const char *const name); void initXML(); -- cgit v1.2.3-60-g2f50