M*LIB: non-inlined strings, FuriString primitive (#1795)
* Quicksave 1 * Header stage complete * Source stage complete * Lint & merge fixes * Includes * Documentation step 1 * FBT: output free size considering BT STACK * Documentation step 2 * py lint * Fix music player plugin * unit test stage 1: string allocator, mem, getters, setters, appends, compare, search. * unit test: string equality * unit test: string replace * unit test: string start_with, end_with * unit test: string trim * unit test: utf-8 * Rename * Revert fw_size changes * Simplify CLI backspace handling * Simplify CLI character insert * Merge fixes * Furi: correct filenaming and spelling * Bt: remove furi string include Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -70,13 +70,13 @@
|
||||
*
|
||||
* do {
|
||||
* uint32_t version = 1;
|
||||
* string_t file_type;
|
||||
* string_t string_value;
|
||||
* FuriString* file_type;
|
||||
* FuriString* string_value;
|
||||
* uint32_t uint32_value = 1;
|
||||
* uint16_t array_size = 4;
|
||||
* uint8_t* array[array_size] = {0};
|
||||
* string_init(file_type);
|
||||
* string_init(string_value);
|
||||
* file_type = furi_string_alloc();
|
||||
* string_value = furi_string_alloc();
|
||||
*
|
||||
* if(!flipper_format_file_open_existing(file, EXT_PATH("flipper_format_test"))) break;
|
||||
* if(!flipper_format_read_header(file, file_type, &version)) break;
|
||||
@@ -94,7 +94,6 @@
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <mlib/m-string.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -227,7 +226,7 @@ bool flipper_format_key_exist(FlipperFormat* flipper_format, const char* key);
|
||||
*/
|
||||
bool flipper_format_read_header(
|
||||
FlipperFormat* flipper_format,
|
||||
string_t filetype,
|
||||
FuriString* filetype,
|
||||
uint32_t* version);
|
||||
|
||||
/**
|
||||
@@ -239,7 +238,7 @@ bool flipper_format_read_header(
|
||||
*/
|
||||
bool flipper_format_write_header(
|
||||
FlipperFormat* flipper_format,
|
||||
string_t filetype,
|
||||
FuriString* filetype,
|
||||
const uint32_t version);
|
||||
|
||||
/**
|
||||
@@ -273,7 +272,7 @@ bool flipper_format_get_value_count(
|
||||
* @param data Value
|
||||
* @return True on success
|
||||
*/
|
||||
bool flipper_format_read_string(FlipperFormat* flipper_format, const char* key, string_t data);
|
||||
bool flipper_format_read_string(FlipperFormat* flipper_format, const char* key, FuriString* data);
|
||||
|
||||
/**
|
||||
* Write key and string
|
||||
@@ -282,7 +281,7 @@ bool flipper_format_read_string(FlipperFormat* flipper_format, const char* key,
|
||||
* @param data Value
|
||||
* @return True on success
|
||||
*/
|
||||
bool flipper_format_write_string(FlipperFormat* flipper_format, const char* key, string_t data);
|
||||
bool flipper_format_write_string(FlipperFormat* flipper_format, const char* key, FuriString* data);
|
||||
|
||||
/**
|
||||
* Write key and string. Plain C string version.
|
||||
@@ -470,7 +469,7 @@ bool flipper_format_write_hex(
|
||||
* @param data Comment text
|
||||
* @return True on success
|
||||
*/
|
||||
bool flipper_format_write_comment(FlipperFormat* flipper_format, string_t data);
|
||||
bool flipper_format_write_comment(FlipperFormat* flipper_format, FuriString* data);
|
||||
|
||||
/**
|
||||
* Write comment. Plain C string version.
|
||||
@@ -495,7 +494,7 @@ bool flipper_format_delete_key(FlipperFormat* flipper_format, const char* key);
|
||||
* @param data Value
|
||||
* @return True on success
|
||||
*/
|
||||
bool flipper_format_update_string(FlipperFormat* flipper_format, const char* key, string_t data);
|
||||
bool flipper_format_update_string(FlipperFormat* flipper_format, const char* key, FuriString* data);
|
||||
|
||||
/**
|
||||
* Updates the value of the first matching key to a string value. Plain C version. Sets the RW pointer to a position at the end of inserted data.
|
||||
@@ -585,7 +584,7 @@ bool flipper_format_update_hex(
|
||||
bool flipper_format_insert_or_update_string(
|
||||
FlipperFormat* flipper_format,
|
||||
const char* key,
|
||||
string_t data);
|
||||
FuriString* data);
|
||||
|
||||
/**
|
||||
* Updates the value of the first matching key to a string value, or adds the key and value if the key did not exist.
|
||||
|
Reference in New Issue
Block a user