Public Member Functions |
| 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 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.
- Author:
- David Sugar <dyfet@gnutelephony.org>
Definition at line 1500 of file string.h.