summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-16 01:47:17 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-16 01:47:17 +0300
commitb293d99a34d21d137374e46386b8669907cb3c1d (patch)
tree7e5e20e2b81e239878c13229c4d02139e8b85c2b /src/utils
parent34f943198afd1f7f342d63bd70d30cdeacd3dbad (diff)
downloadmanaverse-b293d99a34d21d137374e46386b8669907cb3c1d.tar.gz
manaverse-b293d99a34d21d137374e46386b8669907cb3c1d.tar.bz2
manaverse-b293d99a34d21d137374e46386b8669907cb3c1d.tar.xz
manaverse-b293d99a34d21d137374e46386b8669907cb3c1d.zip
add missing const in xmlnode pointers.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/xml.cpp23
-rw-r--r--src/utils/xml.h23
2 files changed, 32 insertions, 14 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index a2de26ee3..94fc18f98 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -140,7 +140,9 @@ namespace XML
return mDoc ? xmlDocGetRootElement(mDoc) : nullptr;
}
- int getProperty(const XmlNodePtr node, const char *const name, int def)
+ int getProperty(const XmlNodePtr node,
+ const char *const name,
+ int def)
{
int &ret = def;
@@ -154,8 +156,11 @@ namespace XML
return ret;
}
- int getIntProperty(const XmlNodePtr node, const char *const name, int def,
- const int min, const int max)
+ int getIntProperty(const XmlNodePtr node,
+ const char *const name,
+ int def,
+ const int min,
+ const int max)
{
int &ret = def;
@@ -172,7 +177,8 @@ namespace XML
return ret;
}
- double getFloatProperty(const XmlNodePtr node, const char *const name,
+ double getFloatProperty(const XmlNodePtr node,
+ const char *const name,
double def)
{
double &ret = def;
@@ -187,7 +193,8 @@ namespace XML
return ret;
}
- std::string getProperty(const XmlNodePtr node, const char *const name,
+ std::string getProperty(const XmlNodePtr node,
+ const char *const name,
const std::string &def)
{
xmlChar *const prop = XmlGetProp(node, name);
@@ -201,7 +208,8 @@ namespace XML
return def;
}
- std::string langProperty(const XmlNodePtr node, const char *const name,
+ std::string langProperty(const XmlNodePtr node,
+ const char *const name,
const std::string &def)
{
std::string str = getProperty(node, name, def);
@@ -211,7 +219,8 @@ namespace XML
return translator->getStr(str);
}
- bool getBoolProperty(const XmlNodePtr node, const char *const name,
+ bool getBoolProperty(const XmlNodePtr node,
+ const char *const name,
const bool def)
{
const xmlChar *const prop = XmlGetProp(node, name);
diff --git a/src/utils/xml.h b/src/utils/xml.h
index 0fa0ba078..5c1fb7605 100644
--- a/src/utils/xml.h
+++ b/src/utils/xml.h
@@ -31,6 +31,7 @@
#include "localconsts.h"
#define XmlNodePtr xmlNodePtr
+#define XmlNodePtrConst xmlNode *const
#define XmlStrEqual(str1, str2) xmlStrEqual(str1, \
reinterpret_cast<const xmlChar*>(str2))
#define xmlNameEqual(node, str) xmlStrEqual((node)->name, \
@@ -96,37 +97,45 @@ namespace XML
/**
* Gets an floating point property from an XmlNodePtr.
*/
- double getFloatProperty(const XmlNodePtr node, const char *const name,
+ double getFloatProperty(const XmlNodePtr node,
+ const char *const name,
double def) A_WARN_UNUSED;
/**
* Gets an integer property from an XmlNodePtr.
*/
- int getProperty(const XmlNodePtr node, const char *const name,
+ int getProperty(const XmlNodePtr node,
+ const char *const name,
int def) A_WARN_UNUSED;
/**
* Gets an integer property from an XmlNodePtr.
*/
- int getIntProperty(const XmlNodePtr node, const char *const name, int def,
- const int min, const int max) A_WARN_UNUSED;
+ int getIntProperty(const XmlNodePtr node,
+ const char *const name,
+ int def,
+ const int min,
+ const int max) A_WARN_UNUSED;
/**
* Gets a string property from an XmlNodePtr.
*/
- std::string getProperty(const XmlNodePtr node, const char *const name,
+ std::string getProperty(const XmlNodePtr node,
+ const char *const name,
const std::string &def) A_WARN_UNUSED;
/**
* Gets a translated string property from an XmlNodePtr.
*/
- std::string langProperty(const XmlNodePtr node, const char *const name,
+ std::string langProperty(const XmlNodePtr node,
+ const char *const name,
const std::string &def) A_WARN_UNUSED;
/**
* Gets a boolean property from an XmlNodePtr.
*/
- bool getBoolProperty(const XmlNodePtr node, const char *const name,
+ bool getBoolProperty(const XmlNodePtr node,
+ const char *const name,
const bool def) A_WARN_UNUSED;
/**