1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

[FL-1791] Flipper file format (#740)

* 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>
This commit is contained in:
SG
2021-10-06 19:40:28 +10:00
committed by GitHub
parent e0c1928fde
commit c8b36dd406
15 changed files with 1100 additions and 158 deletions

View File

@@ -0,0 +1,41 @@
#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);
};