[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

@@ -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;
}

View File

@@ -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