Welcome to mirror list, hosted at ThFree Co, Russian Federation.

flipper_file_helper.h « flipper_file « lib - github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 53dc3ad93c48770de26b457a327d88fb00b89831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#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* const flipper_file_filetype_key;
extern const char* const 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 
 * @param strict
 * @return true if key was found 
 */
bool flipper_file_seek_to_key(File* file, const char* key, bool strict);

/**
 * 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