FileReader.hpp 730 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef CORE_FILE_READER_HPP
  2. #define CORE_FILE_READER_HPP
  3. #include "io/File.hpp"
  4. namespace Core {
  5. using Path = String8<PATH_MAX>;
  6. class FileReader final {
  7. void* file;
  8. Path path;
  9. public:
  10. FileReader();
  11. FileReader(const FileReader& other) = delete;
  12. FileReader(FileReader&& other);
  13. ~FileReader();
  14. FileReader& operator=(const FileReader& other) = delete;
  15. FileReader& operator=(FileReader&& other);
  16. const Path& getPath() const;
  17. Error open(const Path& path);
  18. Error open(const char* path);
  19. Error readChar(int& c);
  20. Error readChars(char* buffer, int bufferSize);
  21. void swap(FileReader& other);
  22. };
  23. }
  24. #endif