XmlDeclaration.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Co-Author: Claude Sonnet 4.6 (LLM)
  4. * Company: Lynar Studios
  5. * E-Mail: webmaster@lynarstudios.com
  6. * Created: 2020-09-27
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #ifndef LS_STD_XML_DECLARATION_HPP
  11. #define LS_STD_XML_DECLARATION_HPP
  12. #include "XmlAttribute.hpp"
  13. #include <ls-std/core/Class.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. /*
  16. * @doc: class(name: 'XmlDeclaration', package: 'io')
  17. * @doc: io.XmlDeclaration.description('This class represents an XML declaration and can be serialized to an XML tag.')
  18. * */
  19. namespace ls::standard::io
  20. {
  21. class LS_STD_DYNAMIC_GOAL XmlDeclaration : public ls::standard::core::Class
  22. {
  23. public:
  24. explicit XmlDeclaration(const ::std::string &_version);
  25. ~XmlDeclaration() noexcept override;
  26. [[nodiscard]] ::std::string getEncoding() const;
  27. [[nodiscard]] ::std::string getStandalone() const;
  28. [[nodiscard]] ::std::string getVersion() const;
  29. void setEncoding(const ::std::string &_encoding);
  30. void setStandalone(const ::std::string &_standalone);
  31. void setVersion(const ::std::string &_version);
  32. [[nodiscard]] ::std::string toXml() const;
  33. private:
  34. ls::standard::io::XmlAttribute encoding{"encoding"};
  35. ls::standard::io::XmlAttribute standalone{"standalone"};
  36. ls::standard::io::XmlAttribute version{"version"};
  37. [[nodiscard]] static ::std::string _toXmlAttribute(const ls::standard::io::XmlAttribute &_attribute);
  38. };
  39. }
  40. #endif