XMLDocument.hpp 852 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-27
  6. * Changed: 2020-09-27
  7. *
  8. * */
  9. #ifndef LS_STD_XML_DOCUMENT_HPP
  10. #define LS_STD_XML_DOCUMENT_HPP
  11. #include <memory>
  12. #include "../../base/Class.hpp"
  13. #include "XMLNode.hpp"
  14. namespace ls_std {
  15. class XMLDocument : public Class {
  16. public:
  17. XMLDocument();
  18. ~XMLDocument() = default;
  19. std::string getHeader();
  20. std::shared_ptr<ls_std::XMLNode> getRootElement();
  21. void parse(const std::string& _xmlStream);
  22. void setRootElement(const std::shared_ptr<ls_std::XMLNode>& _root);
  23. std::string toXML();
  24. private:
  25. std::string header {};
  26. std::shared_ptr<ls_std::XMLNode> rootElement {};
  27. std::string _getHeader();
  28. };
  29. }
  30. #endif