Loading...
Searching...
No Matches
str_buffer.h File Reference

Allows you to create an owned clone of however many strings that you need, then free all of them at once. More...

#include <furi.h>

Go to the source code of this file.

Data Structures

struct  StrBuffer
 StrBuffer instance. More...
 

Functions

const char * str_buffer_make_owned_clone (StrBuffer *buffer, const char *str)
 Makes a owned duplicate of the provided string.
 
void str_buffer_clear_all_clones (StrBuffer *buffer)
 Clears all owned duplicates.
 

Detailed Description

Allows you to create an owned clone of however many strings that you need, then free all of them at once.

Essentially the simplest possible append-only unindexable array of owned C-style strings.

Function Documentation

◆ str_buffer_clear_all_clones()

void str_buffer_clear_all_clones ( StrBuffer * buffer)

Clears all owned duplicates.

Parameters
[in]bufferStrBuffer instance

◆ str_buffer_make_owned_clone()

const char * str_buffer_make_owned_clone ( StrBuffer * buffer,
const char * str )

Makes a owned duplicate of the provided string.

Parameters
[in]bufferStrBuffer instance
[in]strInput C-style string
Returns
C-style string that contains to be valid event after str becomes invalid