Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Dynamic list of strings. More...
#include <string_list.h>
Public Member Functions | |
StringList (IArena &arena) | |
Initialize empty string list. More... | |
size_t | size () const |
Get number of elements. More... | |
bool | is_empty () const |
Check if list is empty. More... | |
const char * | front () const |
Get first string. More... | |
const char * | back () const |
Get last string. More... | |
const char * | nextof (const char *str) const |
Get next string. More... | |
const char * | prevof (const char *str) const |
Get previous string. More... | |
void | clear () |
Clear the list. More... | |
ROC_ATTR_NODISCARD bool | push_back (const char *str) |
Append string to the list. More... | |
ROC_ATTR_NODISCARD bool | push_back (const char *str_begin, const char *str_end) |
Append string from a range to the list. More... | |
ROC_ATTR_NODISCARD const char * | find (const char *str) |
Find string in the list. More... | |
ROC_ATTR_NODISCARD const char * | find (const char *str_begin, const char *str_end) |
Find string in the list. More... | |
Dynamic list of strings.
Strings are stored in a countinous dynamically-growing array. Each string is stored in a block with a header and footer, which both store block length. This allow fast iteration in both directions.
Definition at line 36 of file string_list.h.
|
explicit |
Initialize empty string list.
const char* roc::core::StringList::back | ( | ) | const |
Get last string.
void roc::core::StringList::clear | ( | ) |
Clear the list.
ROC_ATTR_NODISCARD const char* roc::core::StringList::find | ( | const char * | str | ) |
Find string in the list.
ROC_ATTR_NODISCARD const char* roc::core::StringList::find | ( | const char * | str_begin, |
const char * | str_end | ||
) |
Find string in the list.
const char* roc::core::StringList::front | ( | ) | const |
Get first string.
bool roc::core::StringList::is_empty | ( | ) | const |
Check if list is empty.
const char* roc::core::StringList::nextof | ( | const char * | str | ) | const |
const char* roc::core::StringList::prevof | ( | const char * | str | ) | const |
ROC_ATTR_NODISCARD bool roc::core::StringList::push_back | ( | const char * | str | ) |
Append string to the list.
ROC_ATTR_NODISCARD bool roc::core::StringList::push_back | ( | const char * | str_begin, |
const char * | str_end | ||
) |
Append string from a range to the list.
size_t roc::core::StringList::size | ( | ) | const |
Get number of elements.