summaryrefslogtreecommitdiff
path: root/xml-base.h
diff options
context:
space:
mode:
Diffstat (limited to 'xml-base.h')
-rw-r--r--xml-base.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/xml-base.h b/xml-base.h
new file mode 100644
index 0000000..4c63426
--- /dev/null
+++ b/xml-base.h
@@ -0,0 +1,37 @@
+/*
+ * xml-base.h
+ */
+
+#ifndef __XML_BASE_H
+#define __XML_BASE_H
+
+#include "tinyxml/tinyxml.h"
+
+#include <string>
+
+
+class cXmlBase {
+private:
+ std::string path, root_element;
+
+ a_land::TiXmlDocument *document;
+ a_land::TiXmlElement *root;
+protected:
+ virtual ~cXmlBase();
+
+ virtual void copy_to_objects(void) {}
+public:
+ cXmlBase(const char *_root_element);
+
+ bool load(const std::string &_path);
+ void clear(void);
+
+ void add_subelement(a_land::TiXmlElement &main_element,
+ const char *name, const std::string &text);
+
+ a_land::TiXmlDocument *get_document(void) { return document; }
+ a_land::TiXmlElement *get_root(void) { return root; }
+ void set_root(void);
+};
+
+#endif /* __XML_BASE_H */