|
(Note that these are not member symbols.)
|
|
Methods for consruction, destruction, moving, etc
|
GBL_RESULT | GblStringBuffer_construct (GblStringBuffer *pSelf, const char *pString, size_t length, size_t structSize, GblContext *pCtx) |
|
GBL_RESULT | GblStringBuffer_destruct (GblStringBuffer *pSelf) |
|
GBL_RESULT | GblStringBuffer_acquire (GblStringBuffer *pSelf, char *pData, size_t capacity) |
|
GBL_RESULT | GblStringBuffer_release (GblStringBuffer *pSelf, char **ppStrPtr, size_t *pCapacity) |
|
|
Methods for querying or retrieving associated data
|
char * | GblStringBuffer_data (GblStringBuffer *pSelf) |
|
size_t | GblStringBuffer_length (const GblStringBuffer *pSelf) |
|
size_t | GblStringBuffer_capacity (const GblStringBuffer *pSelf) |
|
size_t | GblStringBuffer_stackBytes (const GblStringBuffer *pSelf) |
|
char * | GblStringBuffer_stackBuffer (const GblStringBuffer *pSelf) |
|
GblContext * | GblStringBuffer_context (const GblStringBuffer *pSelf) |
|
GblBool | GblStringBuffer_empty (const GblStringBuffer *pSelf) |
|
GblBool | GblStringBuffer_valid (const GblStringBuffer *pSelf) |
|
GblBool | GblStringBuffer_blank (const GblStringBuffer *pSelf) |
|
GblBool | GblStringBuffer_stack (const GblStringBuffer *pSelf) |
|
|
Methods for converting to other string types
|
const GblStringRef * | GblStringBuffer_createRef (const GblStringBuffer *pSelf) |
|
const char * | GblStringBuffer_cString (const GblStringBuffer *pSelf) |
|
const char * | GblStringBuffer_intern (const GblStringBuffer *pSelf) |
|
GblQuark | GblStringBuffer_quark (const GblStringBuffer *pSelf) |
|
GblQuark | GblStringBuffer_tryQuark (const GblStringBuffer *pSelf) |
|
GblStringView | GblStringBuffer_view (const GblStringBuffer *pSelf, size_t offset, size_t len) |
|
|
Methods for getting and setting individual indices
|
char | GblStringBuffer_at (const GblStringBuffer *pSelf, size_t index) |
|
GBL_RESULT | GblStringBuffer_setChar (const GblStringBuffer *pSelf, size_t index, char value) |
|
|
Methods for setting the value of a constructed string
|
const char * | GblStringBuffer_set (GblStringBuffer *pSelf, const char *pStr, size_t len) |
|
const char * | GblStringBuffer_printf (GblStringBuffer *pSelf, const char *pFmt,...) |
|
const char * | GblStringBuffer_vPrintf (GblStringBuffer *pSelf, const char *pFmt, va_list varArgs) |
|
|
Methods for adding to the beginning of the a string
|
GBL_RESULT | GblStringBuffer_prepend (GblStringBuffer *pSelf, const char *pStr, size_t len) |
|
GBL_RESULT | GblStringBuffer_prependPadding (GblStringBuffer *pSelf, char value, size_t count) |
|
|
Methods for adding to the end of a string
|
GBL_RESULT | GblStringBuffer_append (GblStringBuffer *pSelf, const char *pStr, size_t len) |
|
GBL_RESULT | GblStringBuffer_appendPrintf (GblStringBuffer *pSelf, const char *pFmt,...) |
|
GBL_RESULT | GblStringBuffer_appendVPrintf (GblStringBuffer *pSelf, const char *pFmt, va_list varArgs) |
|
GBL_RESULT | GblStringBuffer_appendPadding (GblStringBuffer *pSelf, char value, size_t count) |
|
GBL_RESULT | GblStringBuffer_appendNil (GblStringBuffer *pSelf) |
|
GBL_RESULT | GblStringBuffer_appendBool (GblStringBuffer *pSelf, GblBool value) |
|
GBL_RESULT | GblStringBuffer_appendInt (GblStringBuffer *pSelf, int value) |
|
GBL_RESULT | GblStringBuffer_appendUint (GblStringBuffer *pSelf, unsigned value) |
|
GBL_RESULT | GblStringBuffer_appendFloat (GblStringBuffer *pSelf, float value) |
|
GBL_RESULT | GblStringBuffer_appendDouble (GblStringBuffer *pSelf, double value) |
|
GBL_RESULT | GblStringBuffer_appendPointer (GblStringBuffer *pSelf, const void *pPtr) |
|
|
Methods for general string modifications
|
GBL_RESULT | GblStringBuffer_insert (GblStringBuffer *pSelf, size_t index, const char *pString, size_t length) |
|
GBL_RESULT | GblStringBuffer_overwrite (GblStringBuffer *pSelf, size_t index, const char *pString, size_t length) |
|
size_t | GblStringBuffer_replace (GblStringBuffer *pSelf, const char *pSubstr, const char *pReplacement, size_t limit, size_t substrLen, size_t replLen) |
|
|
Methods for erasing portions of a string
|
GBL_RESULT | GblStringBuffer_erase (GblStringBuffer *pSelf, size_t offset, size_t len) |
|
GBL_RESULT | GblStringBuffer_clear (GblStringBuffer *pSelf) |
|
size_t | GblStringBuffer_remove (GblStringBuffer *pSelf, const char *pStr, size_t len) |
|
GBL_RESULT | GblStringBuffer_chop (GblStringBuffer *pSelf) |
|
GBL_RESULT | GblStringBuffer_chomp (GblStringBuffer *pSelf) |
|
GBL_RESULT | GblStringBuffer_trimStart (GblStringBuffer *pSelf, char value) |
|
GBL_RESULT | GblStringBuffer_trimEnd (GblStringBuffer *pSelf, char value) |
|
|
Methods for other utilities and string operations
|
GBL_RESULT | GblStringBuffer_lower (GblStringBuffer *pSelf) |
|
GBL_RESULT | GblStringBuffer_upper (GblStringBuffer *pSelf) |
|
GBL_RESULT | GblStringBuffer_reverse (GblStringBuffer *pSelf) |
|
|
Methods for managing size and capacity
|
GBL_RESULT | GblStringBuffer_reserve (GblStringBuffer *pSelf, size_t capacity) |
|
GBL_RESULT | GblStringBuffer_resize (GblStringBuffer *pSelf, size_t size) |
|
GBL_RESULT | GblStringBuffer_grow (GblStringBuffer *pSelf, size_t delta) |
|
GBL_RESULT | GblStringBuffer_shrink (GblStringBuffer *pSelf, size_t delta) |
|
GBL_RESULT | GblStringBuffer_shrinkToFit (GblStringBuffer *pSelf) |
|
Mutable string type optimized for building and writing.
GblStringBuffer is a type of string which is optimized for efficient piece-wise construction, appending, and writing. It's equivalent to a "String Builder" type in other languages, such as C# and Java.
It is typically used temporarily to construct a string, afterwards it is usually converted to another type for storage, such as a GblStringRef or the internal buffer is taken away from it to be stored elsewhere.
Internally it is implemented similarly to a C++-vector, with both a size and a capacity, growing when needed, but not immediatley shrinking.
- Note
- The API around GblStringBuffer is based around modifying strings. For read-only operations on them, such as searching or match counting, use GblStringBuffer_view() and the GblStringView API.
-
GblStringBuffer supports being created with additional trailing storage, allowing it to be over-allocated with malloc() or GBL_ALLOCA(). This means it will not create a separate heap allocation until necessary, and will instead useits trailing allocation region as its internal buffer. This can be very efficient when building temporary strings.
- See also
- GblStringRef, GblStringView, GblQuark
Definition at line 65 of file gimbal_string_buffer.h.