|
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
String buffer. More...
#include <string_buffer.h>
Public Member Functions | |
| StringBuffer (IAllocator &allocator) | |
| 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 exponentionally. | |
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 29 of file string_buffer.h.
|
inlineexplicit |
Initialize empty buffer.
Definition at line 32 of file string_buffer.h.
|
inline |
Copy given string into buffer. str should be zero-terminated.
Definition at line 60 of file string_buffer.h.
|
inline |
Copy given range into buffer. Buffer will be automatically zero-terminated.
Definition at line 68 of file string_buffer.h.
|
inline |
Get zero-terminated string.
Definition at line 48 of file string_buffer.h.
|
inline |
Set buffer to empty string.
Definition at line 53 of file string_buffer.h.
|
inline |
Extend buffer by requested number of characters.
Definition at line 91 of file string_buffer.h.
|
inline |
Grow capacity to be able to hold desired number of characters. Capacity is increased linearly.
Definition at line 106 of file string_buffer.h.
|
inline |
Grow capacity to be able to hold desired number of characters. Capacity is increased exponentionally.
Definition at line 112 of file string_buffer.h.
|
inline |
Check if buffer is empty.
Definition at line 38 of file string_buffer.h.
|
inline |
Get string length, excluding terminating zero.
Definition at line 43 of file string_buffer.h.