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:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <m-array.h>
|
||||
#include <m-string.h>
|
||||
#include <furi.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
typedef enum {
|
||||
@@ -19,7 +19,7 @@ typedef enum {
|
||||
} ArchiveFileTypeEnum;
|
||||
|
||||
typedef struct {
|
||||
string_t path;
|
||||
FuriString* path;
|
||||
ArchiveFileTypeEnum type;
|
||||
bool fav;
|
||||
bool is_app;
|
||||
@@ -29,25 +29,25 @@ static void ArchiveFile_t_init(ArchiveFile_t* obj) {
|
||||
obj->type = ArchiveFileTypeUnknown;
|
||||
obj->is_app = false;
|
||||
obj->fav = false;
|
||||
string_init(obj->path);
|
||||
obj->path = furi_string_alloc();
|
||||
}
|
||||
|
||||
static void ArchiveFile_t_init_set(ArchiveFile_t* obj, const ArchiveFile_t* src) {
|
||||
obj->type = src->type;
|
||||
obj->is_app = src->is_app;
|
||||
obj->fav = src->fav;
|
||||
string_init_set(obj->path, src->path);
|
||||
obj->path = furi_string_alloc_set(src->path);
|
||||
}
|
||||
|
||||
static void ArchiveFile_t_set(ArchiveFile_t* obj, const ArchiveFile_t* src) {
|
||||
obj->type = src->type;
|
||||
obj->is_app = src->is_app;
|
||||
obj->fav = src->fav;
|
||||
string_set(obj->path, src->path);
|
||||
furi_string_set(obj->path, src->path);
|
||||
}
|
||||
|
||||
static void ArchiveFile_t_clear(ArchiveFile_t* obj) {
|
||||
string_clear(obj->path);
|
||||
furi_string_free(obj->path);
|
||||
}
|
||||
|
||||
ARRAY_DEF(
|
||||
|
Reference in New Issue
Block a user