/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2023-02-08 * Changed: 2023-02-17 * * */ #ifndef LS_STD_SECTION_PAIR_ROW_HPP #define LS_STD_SECTION_PAIR_ROW_HPP #include #include #include #include #include #include #include #include namespace ls::std::io { class LS_STD_DYNAMIC_GOAL SectionPairRow : public ::std::enable_shared_from_this, public ls::std::core::Class, public ls::std::core::interface_type::ISerializable { public: explicit SectionPairRow(const ls::std::io::section_pair_identifier &_key, const ls::std::io::SectionPairRowEnumType &_type); ~SectionPairRow() override; [[nodiscard]] ls::std::io::section_pair_identifier getKey(); [[nodiscard]] ::std::shared_ptr getValue(); [[nodiscard]] bool isList(); [[nodiscard]] bool isSingleValue(); [[nodiscard]] ls::std::core::type::byte_field marshal() override; void reserveNewLine(const ::std::string &_reservedNewLine); void setKey(const ls::std::io::section_pair_identifier &_key); void unmarshal(const ls::std::core::type::byte_field &_data) override; private: ls::std::io::section_pair_identifier key{}; ::std::string reservedNewLine{}; ::std::shared_ptr serializable{}; ::std::shared_ptr value{}; void _createSerializable(); void _initValue(const ls::std::io::SectionPairRowEnumType &_type); void _setKey(const ls::std::io::section_pair_identifier &_key); }; } #endif