[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:
@@ -380,4 +380,16 @@ void storage_file_free(File* file) {
|
||||
}
|
||||
|
||||
free(file);
|
||||
}
|
||||
|
||||
bool storage_simply_remove(Storage* storage, const char* path) {
|
||||
FS_Error result;
|
||||
result = storage_common_remove(storage, path);
|
||||
return result == FSE_OK || result == FSE_NOT_EXIST;
|
||||
}
|
||||
|
||||
bool storage_simply_mkdir(Storage* storage, const char* path) {
|
||||
FS_Error result;
|
||||
result = storage_common_mkdir(storage, path);
|
||||
return result == FSE_OK || result == FSE_EXIST;
|
||||
}
|
@@ -230,6 +230,24 @@ FS_Error storage_sd_info(Storage* api, SDInfo* info);
|
||||
*/
|
||||
FS_Error storage_sd_status(Storage* api);
|
||||
|
||||
/***************** Simplified Functions ******************/
|
||||
|
||||
/**
|
||||
* Removes a file/directory from the repository, the directory must be empty and the file/directory must not be open
|
||||
* @param storage pointer to the api
|
||||
* @param path
|
||||
* @return true on success or if file/dir is not exist
|
||||
*/
|
||||
bool storage_simply_remove(Storage* storage, const char* path);
|
||||
|
||||
/**
|
||||
* Creates a directory
|
||||
* @param storage
|
||||
* @param path
|
||||
* @return true on success or if directory is already exist
|
||||
*/
|
||||
bool storage_simply_mkdir(Storage* storage, const char* path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user