SectionPairFileReader.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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-09
  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. * */
  19. namespace ls::std::io
  20. {
  21. class LS_STD_DYNAMIC_GOAL SectionPairFileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
  22. {
  23. public:
  24. explicit SectionPairFileReader(const ls::std::io::SectionPairFileReaderParameter &_parameter);
  25. ~SectionPairFileReader() noexcept override;
  26. [[nodiscard]] ::std::shared_ptr<ls::std::io::SectionPairDocument> getDocument() const;
  27. ls::std::core::type::byte_field read() override; // nodiscard is optional here
  28. private:
  29. ls::std::io::SectionPairFileReaderParameter parameter{};
  30. void _checkFileExtension() const;
  31. void _createDocument();
  32. void _createFileExistenceEvaluator();
  33. void _createReader();
  34. };
  35. }
  36. #endif