FileReader.hpp 1009 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-17
  6. * Changed: 2024-09-13
  7. *
  8. * */
  9. #ifndef LS_STD_FILE_READER_HPP
  10. #define LS_STD_FILE_READER_HPP
  11. #include "File.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. /*
  16. * @doc: class(name: 'FileReader', package: 'io')
  17. * @doc: io.FileReader.description('This class can read the content of a file and return it as byte field.')
  18. * */
  19. namespace ls::std::io
  20. {
  21. class LS_STD_DYNAMIC_GOAL FileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
  22. {
  23. public:
  24. explicit FileReader(const ls::std::io::File &_file);
  25. ~FileReader() noexcept override;
  26. [[nodiscard]] ls::std::core::type::byte_field read() override;
  27. void reset(const ls::std::io::File &_file);
  28. private:
  29. ls::std::io::File file;
  30. };
  31. }
  32. #endif