diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-04-21 14:50:52 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-04-21 14:50:52 -0400 |
commit | 8142a9c87a13cecc7a3698e877f24d89f128c074 (patch) | |
tree | cbee6ae85c5c674dd313c7cfe1420477ee55ca95 /src/xml.cpp | |
parent | 0f70db34d9b47de55b00c558ac3c445f30b7b6a5 (diff) | |
download | therapy-proto-objs.tar.gz therapy-proto-objs.tar.bz2 therapy-proto-objs.zip |
Started working on prototype objects proto-objs
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 | } | ||