SectionPairRowValue.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-10
  6. * Changed: 2024-05-25
  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. * @class(name: 'SectionPairRowValue', package: 'io')
  17. * */
  18. namespace ls::std::io
  19. {
  20. class LS_STD_DYNAMIC_GOAL SectionPairRowValue : public ls::std::core::interface_type::ISerializable
  21. {
  22. public:
  23. explicit SectionPairRowValue(const ls::std::io::SectionPairRowEnumType &_type);
  24. ~SectionPairRowValue() noexcept override;
  25. virtual ls::std::io::SectionPairRowEnumType getType() = 0;
  26. [[nodiscard]] ls::std::core::type::byte_field marshal() override;
  27. void reserveNewLine(::std::string_view _reservedNewLine);
  28. void unmarshal(const ls::std::core::type::byte_field &_data) override;
  29. protected:
  30. [[nodiscard]] ::std::string _getReservedNewLine() const;
  31. [[nodiscard]] ls::std::io::SectionPairRowEnumType _getType() const;
  32. private:
  33. ::std::string reservedNewLine{};
  34. ls::std::io::SectionPairRowEnumType type{};
  35. };
  36. }
  37. #endif