XmlDeclaration.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-27
  6. * Changed: 2024-05-25
  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. /*
  15. * @class(name: 'XmlDeclaration', package: 'io')
  16. * */
  17. namespace ls::std::io
  18. {
  19. class LS_STD_DYNAMIC_GOAL XmlDeclaration : public ls::std::core::Class
  20. {
  21. public:
  22. explicit XmlDeclaration(const ::std::string &_version);
  23. ~XmlDeclaration() noexcept override;
  24. [[nodiscard]] ::std::string getEncoding() const;
  25. [[nodiscard]] ::std::string getStandalone() const;
  26. [[nodiscard]] ::std::string getVersion() const;
  27. void setEncoding(const ::std::string &_encoding);
  28. void setStandalone(const ::std::string &_standalone);
  29. void setVersion(const ::std::string &_version);
  30. [[nodiscard]] ::std::string toXml() const;
  31. private:
  32. ls::std::io::XmlAttribute encoding{"encoding"};
  33. ls::std::io::XmlAttribute standalone{"standalone"};
  34. ls::std::io::XmlAttribute version{"version"};
  35. [[nodiscard]] static ::std::string _toXmlAttribute(const ls::std::io::XmlAttribute &_attribute);
  36. };
  37. }
  38. #endif