XmlDeclaration.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-05-17
  7. *
  8. * */
  9. #ifndef LS_STD_XML_DECLARATION_HPP
  10. #define LS_STD_XML_DECLARATION_HPP
  11. #include "XmlAttribute.hpp"
  12. #include <ls-std/core/Class.hpp>
  13. #include <ls-std/os/dynamic-goal.hpp>
  14. namespace ls::std::io
  15. {
  16. class LS_STD_DYNAMIC_GOAL XmlDeclaration : public ls::std::core::Class
  17. {
  18. public:
  19. explicit XmlDeclaration(const ::std::string &_version);
  20. ~XmlDeclaration() noexcept override;
  21. [[nodiscard]] ::std::string getEncoding() const;
  22. [[nodiscard]] ::std::string getStandalone() const;
  23. [[nodiscard]] ::std::string getVersion() const;
  24. void setEncoding(const ::std::string &_encoding);
  25. void setStandalone(const ::std::string &_standalone);
  26. void setVersion(const ::std::string &_version);
  27. [[nodiscard]] ::std::string toXml() const;
  28. private:
  29. ls::std::io::XmlAttribute encoding{"encoding"};
  30. ls::std::io::XmlAttribute standalone{"standalone"};
  31. ls::std::io::XmlAttribute version{"version"};
  32. [[nodiscard]] static ::std::string _toXmlAttribute(const ls::std::io::XmlAttribute &_attribute);
  33. };
  34. }
  35. #endif