src/lib/DOMBuildingXMLContentHandler.h
branchv_0
changeset 7 afb7f3a4981a
parent 6 6a4a348426d9
child 9 7a6abdd00ab5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lib/DOMBuildingXMLContentHandler.h	Sat Jun 12 20:43:07 2021 +0200
@@ -0,0 +1,56 @@
+/**
+ * Relational pipes
+ * Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#include <libxml++-2.6/libxml++/libxml++.h>
+
+#include "XMLContentHandler.h"
+
+namespace relpipe {
+namespace in {
+namespace asn1 {
+namespace lib {
+
+class DOMBuildingXMLContentHandler : public XMLContentHandler {
+private:
+	xmlpp::Document* document;
+
+public:
+
+	DOMBuildingXMLContentHandler(xmlpp::Document* document) : document(document) {
+		document->create_root_node("DOMBuildingXMLContentHandler"); // FIXME: real implementation
+	}
+
+	void writeStartElement(const std::string& name, const std::vector<std::string>& attributes) override {
+	}
+
+	void writeEndElement() override {
+	}
+
+	void writeCharacters(const std::string& text) override {
+	}
+
+	void writeComment(const std::string& text, bool addSpaces) override {
+		document->get_root_node()->add_child_comment(addSpaces ? " " + text + " " : text);
+	}
+
+};
+
+}
+}
+}
+}