summaryrefslogtreecommitdiff
path: root/lib/xml.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xml.h')
-rw-r--r--lib/xml.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/xml.h b/lib/xml.h
new file mode 100644
index 0000000..ae4a628
--- /dev/null
+++ b/lib/xml.h
@@ -0,0 +1,48 @@
+/*
+ *
+ * xml.h
+ *
+ * (c) 2017 Jörg Wendel
+ *
+ * This code is distributed under the terms and conditions of the
+ * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
+ */
+
+//***************************************************************************
+// Include
+//***************************************************************************
+
+#include <tinyxml2.h>
+
+#include "common.h"
+
+using namespace tinyxml2;
+
+//***************************************************************************
+// Class cXml
+//***************************************************************************
+
+class cXml
+{
+ public:
+
+ cXml();
+
+ int create(const char* rootName);
+ int set(const char* data);
+
+ XMLNode* appendElement(const char* name, const char* value, XMLNode* node = 0);
+ XMLNode* appendElement(const char* name, int value, XMLNode* node = 0);
+
+ XMLNode* getRoot() { return root; }
+ XMLElement* getFirst(XMLNode* node = 0);
+ XMLElement* getNext(XMLNode* node);
+
+ const char* toText();
+
+ private:
+
+ XMLDocument doc;
+ XMLNode* root;
+ XMLPrinter printer;
+};