|
| charbuf () |
| Create a new character buffer with an empty string.
|
|
| charbuf (const char *text) |
| Create a character buffer with assigned text.
|
|
| charbuf (const charbuf ©) |
| Copy constructor.
|
|
size_t | len (void) const |
| Get current length of string.
|
|
| operator bool () const |
| Test if data is contained in the object.
|
|
| operator char * () |
| Get text by casting reference.
|
|
bool | operator! () const |
| Test if the object is empty.
|
|
char * | operator() (size_t offset) |
| Get a pointer to an offset in the object by expression operator.
|
|
char * | operator* () |
| Get text by object pointer reference.
|
|
void | operator+= (const char *text) |
| Concatenate text into the object.
|
|
void | operator= (const char *text) |
| Assign null terminated text to the object.
|
|
char & | operator[] (size_t offset) const |
| Array operator to get a character from the object.
|
|
size_t | size (void) const |
| Get allocated size of the object.
|
|
template<size_t S>
class ucommon::charbuf< S >
A copy-on-write string class that operates by reference count.
This string class anchors a counted object that is managed as a copy-on-write instance of the string data. This means that multiple instances of the string class can refer to the same string in memory if it has not been modifed, which reduces heap allocation. The string class offers functions to manipulate both the string object, and generic safe string functions to manipulate ordinary null terminated character arrays directly in memory.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org A string class that uses a cstring buffer that is fixed in memory. This allows one to manipulate a fixed buffer of text in memory through the string class. The size of the memory used must include space for the overhead() size needed for the cstring object control data.
-
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org A template to create a character array that can be manipulated as a string. This is a mini string/stringbuf class that supports a subset of functionality but does not require a complex supporting object. Like stringbuf, this can be used to create local string variables.
-
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 1459 of file string.h.