XmlDocument.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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-01
  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
  17. {
  18. namespace std
  19. {
  20. namespace io
  21. {
  22. class DYNAMIC_GOAL XmlDocument : public ls::std::core::Class
  23. {
  24. public:
  25. XmlDocument();
  26. ~XmlDocument() override = default;
  27. ::std::shared_ptr<ls::std::io::XmlDeclaration> getDeclaration();
  28. ::std::shared_ptr<ls::std::io::XmlNode> getRootElement();
  29. void setDeclaration(const ::std::shared_ptr<ls::std::io::XmlDeclaration> &_declaration);
  30. void setRootElement(const ::std::shared_ptr<ls::std::io::XmlNode> &_rootElement);
  31. ::std::string toXml();
  32. private:
  33. ::std::shared_ptr<ls::std::io::XmlDeclaration> declaration{};
  34. ::std::shared_ptr<ls::std::io::XmlNode> rootElement{};
  35. void _assignDeclaration(const ::std::shared_ptr<ls::std::io::XmlDeclaration> &_declaration);
  36. void _assignRootElement(const ::std::shared_ptr<ls::std::io::XmlNode> &_rootElement);
  37. };
  38. }
  39. }
  40. }
  41. #endif