flipper-file-cpp.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "flipper-file.h"
  3. class FlipperFileCpp {
  4. private:
  5. FlipperFile* file;
  6. public:
  7. FlipperFileCpp(Storage* storage);
  8. ~FlipperFileCpp();
  9. bool open_read(const char* filename);
  10. bool new_write(const char* filename);
  11. bool close();
  12. bool read_header(string_t filetype, uint32_t* version);
  13. bool write_header(string_t filetype, const uint32_t version);
  14. bool write_header_cstr(const char* filetype, const uint32_t version);
  15. bool read_string(const char* key, string_t data);
  16. bool write_string(const char* key, string_t data);
  17. bool write_string_cstr(const char* key, const char* data);
  18. bool read_uint32(const char* key, uint32_t* data);
  19. bool write_uint32(const char* key, const uint32_t data);
  20. bool write_comment(string_t data);
  21. bool write_comment_cstr(const char* data);
  22. bool write_hex_array(const char* key, const uint8_t* data, const uint16_t data_size);
  23. bool read_hex_array(const char* key, uint8_t* data, const uint16_t data_size);
  24. };