SectionPairFileReader.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-21
  6. * Changed: 2024-09-13
  7. *
  8. * */
  9. #ifndef LS_STD_SECTION_PAIR_FILE_READER_HPP
  10. #define LS_STD_SECTION_PAIR_FILE_READER_HPP
  11. #include "SectionPairFileReaderParameter.hpp"
  12. #include <ls-std/core/Class.hpp>
  13. #include <ls-std/core/interface/IReader.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. #include <memory>
  16. /*
  17. * @doc: class(name: 'SectionPairFileReader', package: 'io')
  18. * @doc: io.SectionPairFileReader.description('This class reads a Section Pair file and writes it to a Section Pair document instance.')
  19. * */
  20. namespace ls::std::io
  21. {
  22. class LS_STD_DYNAMIC_GOAL SectionPairFileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
  23. {
  24. public:
  25. explicit SectionPairFileReader(const ls::std::io::SectionPairFileReaderParameter &_parameter);
  26. ~SectionPairFileReader() noexcept override;
  27. [[nodiscard]] ::std::shared_ptr<ls::std::io::SectionPairDocument> getDocument() const;
  28. ls::std::core::type::byte_field read() override; // nodiscard is optional here
  29. private:
  30. ls::std::io::SectionPairFileReaderParameter parameter{};
  31. void _checkFileExtension() const;
  32. void _createDocument();
  33. void _createFileExistenceEvaluator();
  34. void _createReader();
  35. };
  36. }
  37. #endif