XmlAttribute.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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-23
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #ifndef LS_STD_XML_ATTRIBUTE_HPP
  11. #define LS_STD_XML_ATTRIBUTE_HPP
  12. #include <ls-std/core/Class.hpp>
  13. #include <ls-std/os/dynamic-goal.hpp>
  14. #include <string>
  15. /*
  16. * @doc: class(name: 'XmlAttribute', package: 'io')
  17. * @doc: io.XmlAttribute.description('This class represents an XML attribute and can be serialized to an XML tag.')
  18. * */
  19. namespace ls::standard::io
  20. {
  21. class LS_STD_DYNAMIC_GOAL XmlAttribute : public ls::standard::core::Class
  22. {
  23. public:
  24. explicit XmlAttribute(const ::std::string &_name);
  25. ~XmlAttribute() noexcept override;
  26. [[nodiscard]] ::std::string getName() const;
  27. [[nodiscard]] ::std::string getValue() const;
  28. void setName(const ::std::string &_name);
  29. void setValue(const ::std::string &_value);
  30. [[nodiscard]] ::std::string toXml() const;
  31. private:
  32. ::std::string name{};
  33. ::std::string value{};
  34. void _assignName(const ::std::string &_name);
  35. void _assignValue(const ::std::string &_value);
  36. };
  37. }
  38. #endif