Browse Source

Added XMLDocument class (incomplete)

Patrick 4 years ago
parent
commit
e164fe8de9
2 changed files with 67 additions and 0 deletions
  1. 28 0
      source/io/xml/XMLDeclaration.hpp
  2. 39 0
      source/io/xml/XMLDocument.hpp

+ 28 - 0
source/io/xml/XMLDeclaration.hpp

@@ -0,0 +1,28 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-09-27
+ * Changed:         2020-09-27
+ *
+ * */
+
+#ifndef LS_STD_XML_DECLARATION_HPP
+#define LS_STD_XML_DECLARATION_HPP
+
+#include "../../base/Class.hpp"
+
+namespace ls_std {
+  class XMLDeclaration : public Class {
+    public:
+
+      XMLDeclaration();
+      ~XMLDeclaration() = default;
+
+    private:
+
+      std::string version {};
+  };
+}
+
+#endif

+ 39 - 0
source/io/xml/XMLDocument.hpp

@@ -0,0 +1,39 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-09-27
+ * Changed:         2020-09-27
+ *
+ * */
+
+#ifndef LS_STD_XML_DOCUMENT_HPP
+#define LS_STD_XML_DOCUMENT_HPP
+
+#include <memory>
+#include "../../base/Class.hpp"
+#include "XMLNode.hpp"
+
+namespace ls_std {
+  class XMLDocument : public Class {
+    public:
+
+      XMLDocument();
+      ~XMLDocument() = default;
+
+      std::string getHeader();
+      std::shared_ptr<ls_std::XMLNode> getRootElement();
+      void parse(const std::string& _xmlStream);
+      void setRootElement(const std::shared_ptr<ls_std::XMLNode>& _root);
+      std::string toXML();
+
+    private:
+
+      std::string header {};
+      std::shared_ptr<ls_std::XMLNode> rootElement {};
+
+      std::string _getHeader();
+  };
+}
+
+#endif