SerializableSectionPairDocument.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-16
  6. * Changed: 2023-02-18
  7. *
  8. * */
  9. #ifndef LS_STD_SERIALIZABLE_SECTION_PAIR_DOCUMENT_HPP
  10. #define LS_STD_SERIALIZABLE_SECTION_PAIR_DOCUMENT_HPP
  11. #include "SerializableSectionPairParameter.hpp"
  12. #include <ls-std/core/Class.hpp>
  13. #include <ls-std/core/interface/ISerializable.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. #include <memory>
  16. namespace ls::std::io
  17. {
  18. class LS_STD_DYNAMIC_GOAL SerializableSectionPairDocument : public ls::std::core::interface_type::ISerializable, public ls::std::core::Class
  19. {
  20. public:
  21. explicit SerializableSectionPairDocument(const ls::std::io::SerializableSectionPairParameter &_parameter);
  22. ~SerializableSectionPairDocument() override;
  23. [[nodiscard]] ::std::shared_ptr<ls::std::core::Class> getValue();
  24. [[nodiscard]] ls::std::core::type::byte_field marshal() override;
  25. void unmarshal(const ls::std::core::type::byte_field &_data) override;
  26. private:
  27. ls::std::io::SerializableSectionPairParameter parameter{};
  28. [[nodiscard]] ls::std::core::type::byte_field _getCurrentRow(size_t _iterations, const ls::std::core::type::byte_field &_serializedDocument);
  29. [[nodiscard]] ls::std::core::type::byte_field _getNextSerializedSection(const ls::std::core::type::byte_field &_serializedDocument);
  30. [[nodiscard]] bool _isNotNewSection(const ls::std::core::type::byte_field &_currentRow);
  31. void _addSection(const ls::std::core::type::byte_field &_serializedSection);
  32. };
  33. }
  34. #endif