XmlDocument.hpp 1.3 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: 2022-07-03
  7. *
  8. * */
  9. #ifndef LS_STD_XML_DOCUMENT_HPP
  10. #define LS_STD_XML_DOCUMENT_HPP
  11. #include <memory>
  12. #include <ls_std/core/Class.hpp>
  13. #include "XmlNode.hpp"
  14. #include "XmlDeclaration.hpp"
  15. #include <ls_std/os/dynamic_goal.hpp>
  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 = default;
  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