XmlDocument.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-27
  6. * Changed: 2021-07-16
  7. *
  8. * */
  9. #ifndef LS_STD_XML_DOCUMENT_HPP
  10. #define LS_STD_XML_DOCUMENT_HPP
  11. #include <memory>
  12. #include <ls_std/base/Class.hpp>
  13. #include "XmlNode.hpp"
  14. #include "XmlDeclaration.hpp"
  15. namespace ls_std
  16. {
  17. class XmlDocument : public ls_std::Class
  18. {
  19. public:
  20. XmlDocument();
  21. ~XmlDocument() override = default;
  22. std::shared_ptr<ls_std::XmlDeclaration> getDeclaration();
  23. std::shared_ptr<ls_std::XmlNode> getRootElement();
  24. void setDeclaration(const std::shared_ptr<ls_std::XmlDeclaration> &_declaration);
  25. void setRootElement(const std::shared_ptr<ls_std::XmlNode> &_rootElement);
  26. std::string toXml();
  27. private:
  28. std::shared_ptr<ls_std::XmlDeclaration> declaration{};
  29. std::shared_ptr<ls_std::XmlNode> rootElement{};
  30. void _assignDeclaration(const std::shared_ptr<ls_std::XmlDeclaration> &_declaration);
  31. void _assignRootElement(const std::shared_ptr<ls_std::XmlNode> &_rootElement);
  32. };
  33. }
  34. #endif