SectionPairFileReader.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-21
  6. * Changed: 2023-02-21
  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. namespace ls::std::io
  17. {
  18. class LS_STD_DYNAMIC_GOAL SectionPairFileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
  19. {
  20. public:
  21. explicit SectionPairFileReader(const ls::std::io::SectionPairFileReaderParameter &_parameter);
  22. ~SectionPairFileReader() override;
  23. [[nodiscard]] ::std::shared_ptr<ls::std::io::SectionPairDocument> getDocument();
  24. ls::std::core::type::byte_field read() override; // nodiscard is optional here
  25. private:
  26. ls::std::io::SectionPairFileReaderParameter parameter{};
  27. void _checkFileExtension();
  28. void _createDocument();
  29. void _createFileExistenceEvaluator();
  30. void _createReader();
  31. };
  32. }
  33. #endif