![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
String buffer. More...
#include <roc_core/string_buffer.h>

Public Member Functions | |
| StringBuffer (IArena &arena) | |
| Initialize empty buffer. | |
| bool | is_empty () const |
| Check if buffer is empty. | |
| size_t | len () const |
| Get string length, excluding terminating zero. | |
| const char * | c_str () const |
| Get zero-terminated string. | |
| void | clear () |
| Set buffer to empty string. | |
| bool | assign (const char *str) |
Copy given string into buffer. str should be zero-terminated. | |
| bool | assign (const char *str_begin, const char *str_end) |
| Copy given range into buffer. Buffer will be automatically zero-terminated. | |
| char * | extend (size_t n_chars) |
| Extend buffer by requested number of characters. | |
| bool | grow (size_t desired_len) |
| Grow capacity to be able to hold desired number of characters. Capacity is increased linearly. | |
| bool | grow_exp (size_t desired_len) |
| Grow capacity to be able to hold desired number of characters. Capacity is increased exponentially. | |
String buffer.
Dynamic array storing zero-terminated string. Works on top of Array, but guarantees that the string is always zero-terminated.
| EmbeddedCapacity | is the same as for Array. |
Definition at line 30 of file string_buffer.h.
|
explicit |
Initialize empty buffer.
| bool roc::core::StringBuffer::assign | ( | const char * | str | ) |
Copy given string into buffer. str should be zero-terminated.
Copy given range into buffer. Buffer will be automatically zero-terminated.
| const char * roc::core::StringBuffer::c_str | ( | ) | const |
Get zero-terminated string.
| void roc::core::StringBuffer::clear | ( | ) |
Set buffer to empty string.
| char * roc::core::StringBuffer::extend | ( | size_t | n_chars | ) |
Extend buffer by requested number of characters.
| bool roc::core::StringBuffer::grow | ( | size_t | desired_len | ) |
Grow capacity to be able to hold desired number of characters. Capacity is increased linearly.
| bool roc::core::StringBuffer::grow_exp | ( | size_t | desired_len | ) |
Grow capacity to be able to hold desired number of characters. Capacity is increased exponentially.
| bool roc::core::StringBuffer::is_empty | ( | ) | const |
Check if buffer is empty.
| size_t roc::core::StringBuffer::len | ( | ) | const |
Get string length, excluding terminating zero.