[FL-1926] Flipper File Format addons (#753)
* Flipper file format: remove C wrapper * Flipper file format: open append, float, uint32_t as array, delete key, value count * Flipper file format: fix scratchpad location * Flipper file format: add EOL on append * SubGHZ keystore: update encryption type read and write * Flipper File Format: enhanced version * Flipper File Format: fix naming * Flipper File Format: fix "open" subset naming * Flipper File Format: tests * Flipper File Format: file helper naming * SubGHZ keystore: merge with current state of flipper file format * Flipper File Format: update make recipe * Flipper File Format: open new file method
This commit is contained in:
51
lib/flipper_file/flipper_file_helper.h
Normal file
51
lib/flipper_file/flipper_file_helper.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <mlib/m-string.h>
|
||||
#include <storage/storage.h>
|
||||
#include "file_helper.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const char* flipper_file_filetype_key;
|
||||
extern const char* flipper_file_version_key;
|
||||
extern const char flipper_file_delimiter;
|
||||
extern const char flipper_file_comment;
|
||||
|
||||
/**
|
||||
* Reads a valid key from a file as a string.
|
||||
* After reading, the rw pointer will be on the flipper_file_delimiter symbol.
|
||||
* Optimized not to read comments and values into RAM.
|
||||
* @param file
|
||||
* @param key
|
||||
* @return true on success read
|
||||
*/
|
||||
bool flipper_file_read_valid_key(File* file, string_t key);
|
||||
|
||||
/**
|
||||
* Sets rw pointer to the data after the key
|
||||
* @param file
|
||||
* @param key
|
||||
* @return true if key was found
|
||||
*/
|
||||
bool flipper_file_seek_to_key(File* file, const char* key);
|
||||
|
||||
/**
|
||||
* Write key and key delimiter
|
||||
* @param file
|
||||
* @param key
|
||||
* @return bool
|
||||
*/
|
||||
bool flipper_file_write_key(File* file, const char* key);
|
||||
|
||||
/**
|
||||
* Get scratchpad name and path
|
||||
* @param name
|
||||
* @return bool
|
||||
*/
|
||||
bool flipper_file_get_scratchpad_name(const char** name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user