summaryrefslogtreecommitdiff
path: root/src/utils/xml/pugixml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/xml/pugixml.cpp')
-rw-r--r--src/utils/xml/pugixml.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/utils/xml/pugixml.cpp b/src/utils/xml/pugixml.cpp
index 12ae1d794..12d885a4f 100644
--- a/src/utils/xml/pugixml.cpp
+++ b/src/utils/xml/pugixml.cpp
@@ -212,9 +212,24 @@ namespace XML
return ret;
}
- double getFloatProperty(XmlNodeConstPtr node,
- const char *const name,
- double def)
+ float getFloatProperty(XmlNodeConstPtr node,
+ const char *const name,
+ float def)
+ {
+ float &ret = def;
+
+ if (!node)
+ return ret;
+ const pugi::xml_attribute &attr = node.attribute(name);
+ if (!attr.empty())
+ ret = atof(attr.value());
+
+ return ret;
+ }
+
+ double getDoubleProperty(XmlNodeConstPtr node,
+ const char *const name,
+ double def)
{
double &ret = def;