XmlDocument.hpp 1.2 KB

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