Added flipper_format_write_empty_line(...) (#4029)

* Added flipper_format_write_empty_line(...)
* Format sources

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Jan Wiesemann 2024-12-23 03:32:53 +01:00 committed by GitHub
parent dc73096966
commit e11a62694e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 2 deletions

View File

@ -265,6 +265,7 @@ static bool test_write(const char* file_name) {
if(!flipper_format_file_open_always(file, file_name)) break;
if(!flipper_format_write_header_cstr(file, test_filetype, test_version)) break;
if(!flipper_format_write_comment_cstr(file, "This is comment")) break;
if(!flipper_format_write_empty_line(file)) break;
if(!flipper_format_write_string_cstr(file, test_string_key, test_string_data)) break;
if(!flipper_format_write_int32(file, test_int_key, test_int_data, COUNT_OF(test_int_data)))
break;

View File

@ -403,6 +403,11 @@ bool flipper_format_write_comment_cstr(FlipperFormat* flipper_format, const char
return flipper_format_stream_write_comment_cstr(flipper_format->stream, data);
}
bool flipper_format_write_empty_line(FlipperFormat* flipper_format) {
furi_check(flipper_format);
return flipper_format_stream_write_eol(flipper_format->stream);
}
bool flipper_format_delete_key(FlipperFormat* flipper_format, const char* key) {
furi_check(flipper_format);
FlipperStreamWriteData write_data = {

View File

@ -518,6 +518,14 @@ bool flipper_format_write_comment(FlipperFormat* flipper_format, FuriString* dat
*/
bool flipper_format_write_comment_cstr(FlipperFormat* flipper_format, const char* data);
/** Write empty line (Improves readability for human based parsing)
*
* @param flipper_format Pointer to a FlipperFormat instance
*
* @return True on success
*/
bool flipper_format_write_empty_line(FlipperFormat* flipper_format);
/** Removes the first matching key and its value. Sets the RW pointer to a
* position of deleted data.
*

View File

@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,79.0,,
Version,+,79.1,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/bt/bt_service/bt_keys_storage.h,,
Header,+,applications/services/cli/cli.h,,
@ -1054,6 +1054,7 @@ Function,+,flipper_format_update_uint32,_Bool,"FlipperFormat*, const char*, cons
Function,+,flipper_format_write_bool,_Bool,"FlipperFormat*, const char*, const _Bool*, const uint16_t"
Function,+,flipper_format_write_comment,_Bool,"FlipperFormat*, FuriString*"
Function,+,flipper_format_write_comment_cstr,_Bool,"FlipperFormat*, const char*"
Function,+,flipper_format_write_empty_line,_Bool,FlipperFormat*
Function,+,flipper_format_write_float,_Bool,"FlipperFormat*, const char*, const float*, const uint16_t"
Function,+,flipper_format_write_header,_Bool,"FlipperFormat*, FuriString*, const uint32_t"
Function,+,flipper_format_write_header_cstr,_Bool,"FlipperFormat*, const char*, const uint32_t"

1 entry status name type params
2 Version + 79.0 79.1
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/bt/bt_service/bt_keys_storage.h
5 Header + applications/services/cli/cli.h
1054 Function + flipper_format_write_bool _Bool FlipperFormat*, const char*, const _Bool*, const uint16_t
1055 Function + flipper_format_write_comment _Bool FlipperFormat*, FuriString*
1056 Function + flipper_format_write_comment_cstr _Bool FlipperFormat*, const char*
1057 Function + flipper_format_write_empty_line _Bool FlipperFormat*
1058 Function + flipper_format_write_float _Bool FlipperFormat*, const char*, const float*, const uint16_t
1059 Function + flipper_format_write_header _Bool FlipperFormat*, FuriString*, const uint32_t
1060 Function + flipper_format_write_header_cstr _Bool FlipperFormat*, const char*, const uint32_t

View File

@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,79.0,,
Version,+,79.1,,
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/bt/bt_service/bt_keys_storage.h,,
@ -1164,6 +1164,7 @@ Function,+,flipper_format_update_uint32,_Bool,"FlipperFormat*, const char*, cons
Function,+,flipper_format_write_bool,_Bool,"FlipperFormat*, const char*, const _Bool*, const uint16_t"
Function,+,flipper_format_write_comment,_Bool,"FlipperFormat*, FuriString*"
Function,+,flipper_format_write_comment_cstr,_Bool,"FlipperFormat*, const char*"
Function,+,flipper_format_write_empty_line,_Bool,FlipperFormat*
Function,+,flipper_format_write_float,_Bool,"FlipperFormat*, const char*, const float*, const uint16_t"
Function,+,flipper_format_write_header,_Bool,"FlipperFormat*, FuriString*, const uint32_t"
Function,+,flipper_format_write_header_cstr,_Bool,"FlipperFormat*, const char*, const uint32_t"

1 entry status name type params
2 Version + 79.0 79.1
3 Header + applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h
4 Header + applications/services/bt/bt_service/bt.h
5 Header + applications/services/bt/bt_service/bt_keys_storage.h
1164 Function + flipper_format_write_bool _Bool FlipperFormat*, const char*, const _Bool*, const uint16_t
1165 Function + flipper_format_write_comment _Bool FlipperFormat*, FuriString*
1166 Function + flipper_format_write_comment_cstr _Bool FlipperFormat*, const char*
1167 Function + flipper_format_write_empty_line _Bool FlipperFormat*
1168 Function + flipper_format_write_float _Bool FlipperFormat*, const char*, const float*, const uint16_t
1169 Function + flipper_format_write_header _Bool FlipperFormat*, FuriString*, const uint32_t
1170 Function + flipper_format_write_header_cstr _Bool FlipperFormat*, const char*, const uint32_t