CBuild wiki
Dynamic string - string builder. Specialization of DynArray.h for
char
datatype.
License: GPL-3.0-or-later.
String builder string builder.
char*
data Pointer to data. This pointer
“owns” the data.size_t size Length of string builder. Data in
range from data to data+size is
guaranteed to be valid.size_t capacity Length of allocated data. Data is
guaranteed to be allocated (but may be not initialized) from data to data+size.Format description for string view for printf-style formatters.
Format argument for string view for printf-style formatters.
Append new element to string builder.
cbuild_sb_t*
sb String builder object.char elem Element to append.Append new elements to string builder.
cbuild_sb_t*
sb String builder object.char*
arr Elements to append.size_t arr_size Number of elements to append.Append new elements to string builder.
cbuild_sb_t*
sb String builder object.char … Elements to append.Append c-string to string builder.
cbuild_sb_t*
sb String builder object.char*
cstr C-string (NULL-terminated).Append NULL-terminator to string builder.
cbuild_sb_t*
sb String builder object.Set element in string builder using its index.
cbuild_sb_t*
sb String builder object.size_t idx Element index.char elem New element’s value.bool False on
overflow.
Get element from string builder using its index.
const cbuild_sb_t*
sb String builder object.size_t idx Element index.char Pointer to an
element or NULL if index out of
bounds.
Remove element string builder using its index.
cbuild_sb_t*
sb String builder object.size_t idx Element index.bool False on
overflow.
Resize string builder.
cbuild_sb_t*
sb String builder object.size_t new_size Resize string builder. If new_size
equal 0 default growth strategy will be used.Free string builder.
This should be used only if you want to free underlying memory, if
you just want to clear array and reuse it, setting size to
0 would be much faster.
cbuild_sb_t*
sb String builder object.Foreach implementation for string builder. Same semantics as ‘for’ loop.
cbuild_sb_t*
sb String builder object.name iter Name if variable that will be used as
iterator. Will have type char.strcmp for string builder. Fully compatible but extends
API.
-2 If size of first
string builder is smaller.-1 If first different
character in first string builder is smaller.0 If two string
builders are equal.1 If first different
character in first string builder is larger.2 If size of first
string builder is larger.strcmp for string builder. Fully compatible but extends
API. Performs case folding for ASCII.
-2 If size of first
string builder is smaller.-1 If first different
character in first string builder is smaller.0 If two string
builders are equal.1 If first different
character in first string builder is larger.2 If size of first
string builder is larger.Append utf8 character to a string builder.
cbuild_sb_t*
sb String builder object.uint32_t
cp UTF8 codepoint.Get length of a string builder in utf8 codepoints.
Invalid codepoints assumed to have length of 1
Convert string builder to a string view.
Convert string builder to a string view.
Convert string view to a string builder (allocated new data).
Convert string view to a string builder (allocated new data).
Apppend string view to a string builder
cbuild_sb_t*
sb String builder object.cbuild_sv_t cstr String view.Append data to a string builder using printf-style format string.
Append data to a string builder using printf-style format string.