XmlDeclaration.hpp 1.4 KB

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