/*
 * Author:          Patrick-Christopher Mattulat
 * Co-Author:       Claude Sonnet 4.6 (LLM)
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2020-09-27
 * Changed:         2026-06-23
 *
 * */

#ifndef LS_STD_XML_DECLARATION_HPP
#define LS_STD_XML_DECLARATION_HPP

#include "XmlAttribute.hpp"
#include <ls-std/core/Class.hpp>
#include <ls-std/os/dynamic-goal.hpp>

/*
 * @doc: class(name: 'XmlDeclaration', package: 'io')
 * @doc: io.XmlDeclaration.description('This class represents an XML declaration and can be serialized to an XML tag.')
 * */

namespace ls::standard::io
{
  class LS_STD_DYNAMIC_GOAL XmlDeclaration : public ls::standard::core::Class
  {
    public:

      explicit XmlDeclaration(const ::std::string &_version);
      ~XmlDeclaration() noexcept override;

      [[nodiscard]] ::std::string getEncoding() const;
      [[nodiscard]] ::std::string getStandalone() const;
      [[nodiscard]] ::std::string getVersion() const;
      void setEncoding(const ::std::string &_encoding);
      void setStandalone(const ::std::string &_standalone);
      void setVersion(const ::std::string &_version);
      [[nodiscard]] ::std::string toXml() const;

    private:

      ls::standard::io::XmlAttribute encoding{"encoding"};
      ls::standard::io::XmlAttribute standalone{"standalone"};
      ls::standard::io::XmlAttribute version{"version"};

      [[nodiscard]] static ::std::string _toXmlAttribute(const ls::standard::io::XmlAttribute &_attribute);
  };
}

#endif
