c8b36dd406
* Lib: new flipper file format library * Lib: flipper file format cpp wrapper * Storage: simple function for remove file and check error * iButton app: remove file worker, use new flipper file format instead * Dialogs: storage error message * Storage: simple function for mkdir and check error * iButton app: error messages * Libs: update makefile * RFID app: remove file worker, use new flipper file format instead * Flipper File: library documentation Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
#pragma once
|
|
#include "flipper-file.h"
|
|
|
|
class FlipperFileCpp {
|
|
private:
|
|
FlipperFile* file;
|
|
|
|
public:
|
|
FlipperFileCpp(Storage* storage);
|
|
~FlipperFileCpp();
|
|
|
|
bool open_read(const char* filename);
|
|
|
|
bool new_write(const char* filename);
|
|
|
|
bool close();
|
|
|
|
bool read_header(string_t filetype, uint32_t* version);
|
|
|
|
bool write_header(string_t filetype, const uint32_t version);
|
|
|
|
bool write_header_cstr(const char* filetype, const uint32_t version);
|
|
|
|
bool read_string(const char* key, string_t data);
|
|
|
|
bool write_string(const char* key, string_t data);
|
|
|
|
bool write_string_cstr(const char* key, const char* data);
|
|
|
|
bool read_uint32(const char* key, uint32_t* data);
|
|
|
|
bool write_uint32(const char* key, const uint32_t data);
|
|
|
|
bool write_comment(string_t data);
|
|
|
|
bool write_comment_cstr(const char* data);
|
|
|
|
bool write_hex_array(const char* key, const uint8_t* data, const uint16_t data_size);
|
|
|
|
bool read_hex_array(const char* key, uint8_t* data, const uint16_t data_size);
|
|
};
|