SectionPairRowValue.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-10
  6. * Changed: 2024-09-13
  7. *
  8. * */
  9. #ifndef LS_STD_SECTION_PAIR_ROW_VALUE_HPP
  10. #define LS_STD_SECTION_PAIR_ROW_VALUE_HPP
  11. #include <ls-std/core/interface/ISerializable.hpp>
  12. #include <ls-std/io/section-pair/SectionPairRowEnumType.hpp>
  13. #include <ls-std/os/dynamic-goal.hpp>
  14. #include <string_view>
  15. /*
  16. * @doc: class(name: 'SectionPairRowValue', package: 'io')
  17. * @doc: io.SectionPairRowValue.description('This class represents a Section Pair row value.')
  18. * */
  19. namespace ls::std::io
  20. {
  21. class LS_STD_DYNAMIC_GOAL SectionPairRowValue : public ls::std::core::interface_type::ISerializable
  22. {
  23. public:
  24. explicit SectionPairRowValue(const ls::std::io::SectionPairRowEnumType &_type);
  25. ~SectionPairRowValue() noexcept override;
  26. virtual ls::std::io::SectionPairRowEnumType getType() = 0;
  27. [[nodiscard]] ls::std::core::type::byte_field marshal() override;
  28. void reserveNewLine(::std::string_view _reservedNewLine);
  29. void unmarshal(const ls::std::core::type::byte_field &_data) override;
  30. protected:
  31. [[nodiscard]] ::std::string _getReservedNewLine() const;
  32. [[nodiscard]] ls::std::io::SectionPairRowEnumType _getType() const;
  33. private:
  34. ::std::string reservedNewLine{};
  35. ls::std::io::SectionPairRowEnumType type{};
  36. };
  37. }
  38. #endif