+\r
+std::string getProperty(xmlNodePtr theNode, const char* thePropName)\r
+{\r
+ std::string result = "";\r
+ char* aPropChars = (char*) xmlGetProp(theNode, BAD_CAST thePropName);\r
+ if (!aPropChars || aPropChars[0] == 0)\r
+ return result;\r
+ result = std::string(aPropChars);\r
+ return result;\r
+}\r
+\r
+std::string getNormalizedProperty(xmlNodePtr theNode, const char* thePropName)\r
+{\r
+ return normalize(getProperty(theNode, thePropName));\r
+}\r
+\r
+bool getBooleanAttribute(xmlNodePtr theNode, const char* theAttributeName, bool theDefault)\r
+{\r
+ std::string prop = normalize(getProperty(theNode, theAttributeName));\r
+ bool result = theDefault;\r
+ if (prop == "true" || prop == "1") {\r
+ result = true;\r
+ } else if (prop == "false" || prop == "0") {\r
+ result = false;\r
+ }\r
+ return result;\r
+}\r
+\r
+CONFIG_EXPORT std::string normalize(const char* theString)\r
+{\r
+ if (!theString)\r
+ return std::string();\r
+ return normalize(std::string(theString));\r
+}\r
+\r
+CONFIG_EXPORT std::string normalize(const std::string& theString)\r
+{\r
+ std::string result = theString;\r
+ std::transform(result.begin(), result.end(), result.begin(), ::tolower);\r
+ return result;\r
+}\r