12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2023-02-16
- * Changed: 2024-09-13
- *
- * */
- #ifndef LS_STD_SERIALIZABLE_SECTION_PAIR_DOCUMENT_HPP
- #define LS_STD_SERIALIZABLE_SECTION_PAIR_DOCUMENT_HPP
- #include "SerializableSectionPairParameter.hpp"
- #include <ls-std/core/Class.hpp>
- #include <ls-std/core/interface/ISerializable.hpp>
- #include <ls-std/os/dynamic-goal.hpp>
- #include <memory>
- #include <string_view>
- /*
- * @doc: class(name: 'SerializableSectionPairDocument', package: 'io')
- * @doc: io.SerializableSectionPairDocument.description('This class can serialize a Section Pair document for file persistence.')
- * */
- namespace ls::std::io
- {
- class LS_STD_DYNAMIC_GOAL SerializableSectionPairDocument : public ls::std::core::interface_type::ISerializable, public ls::std::core::Class
- {
- public:
- explicit SerializableSectionPairDocument(const ls::std::io::SerializableSectionPairParameter &_parameter);
- ~SerializableSectionPairDocument() noexcept override;
- [[nodiscard]] ::std::shared_ptr<ls::std::core::Class> getValue() const;
- [[nodiscard]] ls::std::core::type::byte_field marshal() override;
- void unmarshal(const ls::std::core::type::byte_field &_data) override;
- private:
- ls::std::io::SerializableSectionPairParameter parameter{};
- [[nodiscard]] ls::std::core::type::byte_field _getCurrentRow(size_t _iterations, ::std::string_view _serializedDocument) const;
- [[nodiscard]] ls::std::core::type::byte_field _getNextSerializedSection(const ls::std::core::type::byte_field &_serializedDocument) const;
- [[nodiscard]] bool _isNotNewSection(::std::string_view _currentRow) const;
- void _addSection(const ls::std::core::type::byte_field &_serializedSection) const;
- };
- }
- #endif
|