Public Member Functions |
void | operator= (char *text) |
| Assign a string buffer from a null terminated string.
|
void | operator= (string &object) |
| Assign a string buffer from another string object.
|
| stringbuf () |
| Create an empty instance of a string buffer.
|
| stringbuf (char *text) |
| Create a string buffer from a null terminated string.
|
| memstring (void *memory, strsize_t size, char fill=0) |
| Create an instance of a memory string.
|
| ~memstring () |
| Destroy memory string.
|
int | __isoc99_scanf (char *format,...) |
| Scan input items from a string object.
|
int | __isoc99_vscanf (char *format, va_list args) |
| Scan input items from a string object.
|
void | add (char *text) |
| Append null terminated text to our string buffer.
|
void | add (char character) |
| Append a single character to our string buffer.
|
char | at (int position) |
| Return character found at a specific position in the string.
|
char * | begin (void) |
| Get pointer to first character in string for iteration.
|
char * | c_mem (void) |
| Get memory text buffer of string object.
|
char * | c_str (void) |
| Get character text buffer of string object.
|
strsize_t | ccount (char *list) |
| Count number of occurrences of characters in string.
|
void | chop (char *list) |
| Chop trailing characters from the string.
|
char * | chr (char character) |
| Find pointer in string where specified character appears.
|
void | clear (strsize_t offset, strsize_t size=0) |
| Clear a field of a filled string with filler.
|
void | clear (void) |
| Clear string by setting to empty.
|
strsize_t | count (void) |
| Count all characters in the string (strlen).
|
void | cut (strsize_t offset, strsize_t size=0) |
| Cut (remove) text from string.
|
char * | end (void) |
| Get pointer to last character in string for iteration.
|
char | fill (void) |
| Get filler character used for field array strings.
|
char * | find (char *list, strsize_t offset=0) |
| Find a character in the string.
|
char * | first (char *list) |
| Find first occurrence of a character in the string.
|
bool | full (void) |
| Test if the string's allocated space is all used up.
|
string | get (strsize_t offset, strsize_t size=0) |
| Get a new string object as a substring of the current object.
|
char * | last (char *list) |
| Find last occurrence of a character in the string.
|
strsize_t | len (void) |
| Get length of string.
|
void | lower (void) |
| Convert string to lower case.
|
strsize_t | offset (char *pointer) |
| Find offset of a pointer into our string buffer.
|
| operator bool () |
| Test if string has data.
|
| operator char * () |
| Casting reference to raw text string.
|
bool | operator! () |
| Test if string is empty.
|
bool | operator!= (char *text) |
| Compare our object with null terminated text.
|
string & | operator% (short &value) |
| Parse short integer value from a string.
|
string & | operator% (unsigned short &value) |
| Parse long integer value from a string.
|
string & | operator% (long &value) |
| Parse long integer value from a string.
|
string & | operator% (unsigned long &value) |
| Parse long integer value from a string.
|
string & | operator% (double &value) |
| Parse double value from a string.
|
string & | operator% (char *text) |
| Parse text from a string in a scan expression.
|
string & | operator& (char *text) |
| Concatenate null terminated text to our object.
|
string | operator() (int offset, strsize_t size) |
| Get a new substring through object expression.
|
char * | operator() (int offset) |
| Reference a string in the object by relative offset.
|
char * | operator* () |
| Reference raw text buffer by pointer operator.
|
string & | operator+ (char *text) |
| Concatenate null terminated text to our object.
|
string & | operator++ (void) |
| Delete first character from string.
|
string & | operator+= (char *text) |
| Concatenate text to an existing string object.
|
string & | operator+= (strsize_t number) |
| Delete a specified number of characters from start of string.
|
string & | operator-- (void) |
| Delete last character from string.
|
string & | operator-= (strsize_t number) |
| Delete a specified number of characters from end of string.
|
bool | operator< (char *text) |
| Compare our object with null terminated text.
|
bool | operator<= (char *text) |
| Compare our object with null terminated text.
|
bool | operator== (char *text) |
| Compare our object with null terminated text.
|
bool | operator> (char *text) |
| Compare our object with null terminated text.
|
bool | operator>= (char *text) |
| Compare our object with null terminated text.
|
char | operator[] (int offset) |
| Reference a single character in string object by array offset.
|
string & | operator^= (string &object) |
| Create new cow instance and assign value from another string object.
|
string & | operator^= (char *text) |
| Create new cow instance and assign value from null terminated text.
|
strsize_t | printf (char *format,...) |
| Print items into a string object.
|
char * | rchr (char character) |
| Find pointer in string where specified character last appears.
|
virtual bool | resize (strsize_t size) |
| Resize and re-allocate string memory.
|
char * | rfind (char *list, strsize_t offset=npos) |
| Find last occurrence of character in the string.
|
void | rset (char *text, char overflow, strsize_t offset, strsize_t size=0) |
| Set a text field within our string object offset from the end of buffer.
|
char * | rskip (char *list, strsize_t offset=npos) |
| Skip trailing characters in the string.
|
void | rsplit (char *pointer) |
| Split the string by a pointer position.
|
void | rsplit (strsize_t offset) |
| Split the string at a specific offset.
|
void | set (char *text) |
| Set string object to text of a null terminated string.
|
void | set (strsize_t offset, char *text, strsize_t size=0) |
| Set a portion of the string object at a specified offset to a text string.
|
void | set (char *text, char overflow, strsize_t offset, strsize_t size=0) |
| Set a text field within our string object.
|
strsize_t | size (void) |
| Get the size of currently allocated space for string.
|
char * | skip (char *list, strsize_t offset=0) |
| Skip lead characters in the string.
|
void | split (char *pointer) |
| Split the string by a pointer position.
|
void | split (strsize_t offset) |
| Split the string at a specific offset.
|
| string () |
| Create a new empty string object.
|
| string (long value) |
| Create a string from a long integer.
|
| string (double value) |
| Create a string from a floating point.
|
| string (strsize_t size) |
| Create an empty string with a buffer pre-allocated to a specified size.
|
| string (strsize_t size, char fill) |
| Create a filled string with a buffer pre-allocated to a specified size.
|
| string (strsize_t size, char *format,...) |
| Create a string by printf-like formating into a pre-allocated space of a specified size.
|
| string (char *text) |
| Create a string from null terminated text.
|
| string (char *text, strsize_t size) |
| Create a string from null terminated text up to a maximum specified size.
|
| string (char *text, char *end) |
| Create a string for a substring.
|
| string (string &existing) |
| Construct a copy of a string object.
|
void | strip (char *list) |
| Strip lead and trailing characters from the string.
|
void | trim (char *list) |
| Trim lead characters from the string.
|
bool | unquote (char *quote) |
| Unquote a quoted string.
|
void | upper (void) |
| Convert string to upper case.
|
strsize_t | vprintf (char *format, va_list args) |
| Print items into a string object.
|
virtual | ~string () |
| Destroy string.
|
ObjectProtocol * | copy (void) |
| Retain (increase retention of) object when copying.
|
virtual | ~ObjectProtocol () |
| Required virtual destructor.
|
template<strsize_t S>
class ucommon::stringbuf< S >
A string class that has a predefined string buffer.
The string class and buffer are allocated together as one object. This allows one to use string objects entirely resident on the local stack as well as on the heap. Using a string class on the local stack may be more convenient than a char array since one can use all the features of the class including assignment and concatenation which a char buffer cannot as easily do.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 1605 of file string.h.