XmlAttribute.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-23
  6. * Changed: 2024-09-13
  7. *
  8. * */
  9. #ifndef LS_STD_XML_ATTRIBUTE_HPP
  10. #define LS_STD_XML_ATTRIBUTE_HPP
  11. #include <ls-std/core/Class.hpp>
  12. #include <ls-std/os/dynamic-goal.hpp>
  13. #include <string>
  14. /*
  15. * @doc: class(name: 'XmlAttribute', package: 'io')
  16. * @doc: io.XmlAttribute.description('This class represents an XML attribute and can be serialized to an XML tag.')
  17. * */
  18. namespace ls::std::io
  19. {
  20. class LS_STD_DYNAMIC_GOAL XmlAttribute : public ls::std::core::Class
  21. {
  22. public:
  23. explicit XmlAttribute(const ::std::string &_name);
  24. ~XmlAttribute() noexcept override;
  25. [[nodiscard]] ::std::string getName() const;
  26. [[nodiscard]] ::std::string getValue() const;
  27. void setName(const ::std::string &_name);
  28. void setValue(const ::std::string &_value);
  29. [[nodiscard]] ::std::string toXml() const;
  30. private:
  31. ::std::string name{};
  32. ::std::string value{};
  33. void _assignName(const ::std::string &_name);
  34. void _assignValue(const ::std::string &_value);
  35. };
  36. }
  37. #endif