diff options
Diffstat (limited to 'src/xml.cpp')
-rw-r--r-- | src/xml.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xml.cpp b/src/xml.cpp new file mode 100644 index 0000000..f6f60ea --- /dev/null +++ b/src/xml.cpp | |||
@@ -0,0 +1,13 @@ | |||
1 | #include "xml.h" | ||
2 | #include <stdexcept> | ||
3 | |||
4 | xmlChar* getProp(xmlNodePtr node, const char* attr) | ||
5 | { | ||
6 | xmlChar* key = xmlGetProp(node, reinterpret_cast<const xmlChar*>(attr)); | ||
7 | if (key == nullptr) | ||
8 | { | ||
9 | throw std::invalid_argument("Error parsing XML file"); | ||
10 | } | ||
11 | |||
12 | return key; | ||
13 | } | ||