summaryrefslogtreecommitdiff
path: root/src/utils/xml/pugixml.inc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-21 16:07:23 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-21 16:08:41 +0300
commitd6bae76908e2d75dc9825b85fde19102369ad2f4 (patch)
tree587336e2a71c20bf6ea44fb4798d8b09a7c4e4ca /src/utils/xml/pugixml.inc
parent3439b247f9528a55b8d83e98011e305fd8ff4e0d (diff)
downloadmanaverse-d6bae76908e2d75dc9825b85fde19102369ad2f4.tar.gz
manaverse-d6bae76908e2d75dc9825b85fde19102369ad2f4.tar.bz2
manaverse-d6bae76908e2d75dc9825b85fde19102369ad2f4.tar.xz
manaverse-d6bae76908e2d75dc9825b85fde19102369ad2f4.zip
Add support for writing xml files from pugixml.
Diffstat (limited to 'src/utils/xml/pugixml.inc')
-rw-r--r--src/utils/xml/pugixml.inc19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/utils/xml/pugixml.inc b/src/utils/xml/pugixml.inc
index 4350a8e71..f6257a967 100644
--- a/src/utils/xml/pugixml.inc
+++ b/src/utils/xml/pugixml.inc
@@ -36,20 +36,17 @@
#define xmlChar char
#define XmlFree(ptr)
#define XmlNodeDefault pugi::xml_node()
-
-// +++ need impliment get context
#define XmlNodeGetContent(node) (node).child_value()
-
-// +++ need impliment writing code
-#define XmlTextWriterPtr pugi::xml_writer*
-#define XmlTextWriterStartElement(writer, name)
-#define XmlTextWriterEndElement(writer)
-#define XmlTextWriterWriteAttribute(writer, name, content)
-#define XmlNewTextWriterFilename(name, flags) nullptr;
+#define XmlTextWriterPtr XML::Writer *
+#define XmlTextWriterStartElement(writer, name) (writer)->startNode(name)
+#define XmlTextWriterEndElement(writer) (writer)->endNode()
+#define XmlTextWriterWriteAttribute(writer, name, content) \
+ (writer)->addAttribute(name, content)
+#define XmlNewTextWriterFilename(name, flags) new XML::Writer(name);
#define XmlTextWriterSetIndent(writer, flags)
#define XmlTextWriterStartDocument(writer, p1, p2, p3)
-#define XmlTextWriterEndDocument(writer)
-#define XmlFreeTextWriter(writer)
+#define XmlTextWriterEndDocument(writer) (writer)->endDocument()
+#define XmlFreeTextWriter(writer) delete writer
#endif // ENABLE_PUGIXML
#endif // UTILS_XML_PUGIXML_INC