diff options
Diffstat (limited to 'src/utils/xml/tinyxml2.cpp')
-rw-r--r-- | src/utils/xml/tinyxml2.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/utils/xml/tinyxml2.cpp b/src/utils/xml/tinyxml2.cpp index 3a1646168..a7275b7f1 100644 --- a/src/utils/xml/tinyxml2.cpp +++ b/src/utils/xml/tinyxml2.cpp @@ -198,9 +198,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 char *attr = node->Attribute(name); + if (attr != nullptr) + ret = atof(attr); + + return ret; + } + + double getDoubleProperty(XmlNodeConstPtr node, + const char *const name, + double def) { double &ret = def; |