FileReader.hpp 1.1 KB

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