file-worker.h 592 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "record-controller.hpp"
  3. #include <sd-card-api.h>
  4. #include <filesystem-api.h>
  5. #include <m-string.h>
  6. class FileWorker {
  7. public:
  8. FileWorker();
  9. ~FileWorker();
  10. RecordController<FS_Api> fs_api;
  11. RecordController<SdCard_Api> sd_ex_api;
  12. bool open(const char* filename, FS_AccessMode access_mode, FS_OpenMode open_mode);
  13. bool close();
  14. bool mkdir(const char* dirname);
  15. bool remove(const char* filename);
  16. private:
  17. File file;
  18. bool check_common_errors();
  19. void show_error_message(const char* error_text);
  20. string_t error_string;
  21. };