#include <yateclass.h>
Inheritance diagram for String:
Public Member Functions | |
String () | |
String (const char *value, int len=-1) | |
String (char value, unsigned int repeat=1) | |
String (int value) | |
String (unsigned int value) | |
String (bool value) | |
String (const String &value) | |
String (const String *value) | |
virtual | ~String () |
virtual void * | getObject (const String &name) const |
const char * | c_str () const |
const char * | safe () const |
unsigned int | length () const |
bool | null () const |
unsigned int | hash () const |
void | clear () |
char | at (int index) const |
String | substr (int offs, int len=-1) const |
String & | trimBlanks () |
virtual const String & | toString () const |
int | toInteger (int defvalue=0, int base=0) const |
int | toInteger (const TokenDict *tokens, int defvalue=0, int base=0) const |
double | toDouble (double defvalue=0.0) const |
bool | toBoolean (bool defvalue=false) const |
bool | isBoolean () const |
String & | toUpper () |
String & | toLower () |
char | operator[] (int index) const |
operator const char * () const | |
String & | assign (const char *value, int len=-1) |
String & | assign (char value, unsigned int repeat=1) |
String & | hexify (void *data, unsigned int len, char sep=0, bool upCase=false) |
String & | operator= (const String &value) |
String & | operator= (const String *value) |
String & | operator= (const char *value) |
String & | operator= (char value) |
String & | operator= (int value) |
String & | operator= (unsigned int value) |
String & | operator= (bool value) |
String & | operator+= (const char *value) |
String & | operator+= (char value) |
String & | operator+= (int value) |
String & | operator+= (unsigned int value) |
String & | operator+= (bool value) |
bool | operator== (const char *value) const |
bool | operator!= (const char *value) const |
bool | operator== (const String &value) const |
bool | operator!= (const String &value) const |
bool | operator &= (const char *value) const |
bool | operator|= (const char *value) const |
String & | operator<< (const char *value) |
String & | operator<< (char value) |
String & | operator<< (int value) |
String & | operator<< (unsigned int value) |
String & | operator<< (bool value) |
String & | operator>> (const char *skip) |
String & | operator>> (char &store) |
String & | operator>> (int &store) |
String & | operator>> (unsigned int &store) |
String & | operator>> (bool &store) |
String & | append (const char *value, const char *separator=0, bool force=false) |
String & | append (double value, unsigned int decimals=3) |
int | find (char what, unsigned int offs=0) const |
int | find (const char *what, unsigned int offs=0) const |
int | rfind (char what) const |
bool | startsWith (const char *what, bool wordBreak=false, bool caseInsensitive=false) const |
bool | endsWith (const char *what, bool wordBreak=false, bool caseInsensitive=false) const |
bool | startSkip (const char *what, bool wordBreak=true, bool caseInsensitive=false) |
virtual bool | matches (const String &value) const |
bool | matches (Regexp &rexp) |
int | matchOffset (int index=0) const |
int | matchLength (int index=0) const |
String | matchString (int index=0) const |
String | replaceMatches (const String &templ) const |
int | matchCount () const |
ObjList * | split (char separator, bool emptyOK=true) const |
String | msgEscape (char extraEsc=0) const |
String | msgUnescape (int *errptr=0, char extraEsc=0) const |
String | sqlEscape (char extraEsc=0) const |
String | uriEscape (char extraEsc=0) const |
String | uriUnescape (int *errptr=0) const |
Static Public Member Functions | |
static const String & | empty () |
static const char * | boolText (bool value) |
static unsigned int | hash (const char *value) |
static String | msgEscape (const char *str, char extraEsc=0) |
static String | msgUnescape (const char *str, int *errptr=0, char extraEsc=0) |
static String | sqlEscape (const char *str, char extraEsc=0) |
static String | uriEscape (const char *str, char extraEsc=0) |
static String | uriUnescape (const char *str, int *errptr=0) |
Protected Member Functions | |
virtual void | changed () |
A simple string handling class for C style (one byte) strings. For simplicity and read speed no copy-on-write is performed. Strings have hash capabilities and comparations are using the hash for fast inequality check.
|
Creates a new, empty string. |
|
Creates a new initialized string.
|
|
Creates a new initialized string.
|
|
Creates a new initialized string from an integer.
|
|
Creates a new initialized string from an unsigned int.
|
|
Creates a new initialized string from a boolean.
|
|
Copy constructor.
|
|
Constructor from String pointer.
|
|
Destroys the string, disposes the memory. |
|
Explicit double append
|
|
Conditional appending with a separator
|
|
Assigns a new value by filling with a repeated character
|
|
Assigns a new value to the string from a character block.
|
|
Extract the caracter at a given index
|
|
A standard text representation of boolean values
|
|
Get the value of the stored string.
|
|
Called whenever the value changed (except in constructors). Reimplemented in Regexp, URI, and DataFormat. |
|
Clear the string and free the memory |
|
A static null String |
|
Checks if the string ends with a substring
|
|
Locate the first instance of a substring in the string
|
|
Locate the first instance of a character in the string
|
|
Get a pointer to a derived class given that class name
Reimplemented from GenObject. |
|
Get the hash of an arbitrary string.
|
|
Get the hash of the contained string.
|
|
Build a hexadecimal representation of a buffer of data
|
|
Check if the string can be converted to a boolean value.
|
|
Get the length of the stored string.
Reimplemented in NamedList. |
|
Get the total number of submatches from the last match, 0 if no match
|
|
Checks if matches a regular expression and fill the match substrings
|
|
Checks if matches another string
Reimplemented in Regexp. |
|
Get the length of the last match
|
|
Get the offset of the last match
|
|
Get a copy of a matched (sub)string
|
|
Create an escaped string suitable for use in messages
|
|
Create an escaped string suitable for use in messages
|
|
Decode an escaped string back to its raw form
|
|
Decode an escaped string back to its raw form
|
|
Checks if the string holds a NULL pointer.
|
|
Case-insensitive equality operator. |
|
Conversion to "const char *" operator.
|
|
Fast inequality operator. |
|
Inequality operator. |
|
Appending operator for booleans. |
|
Appending operator for unsigned integers. |
|
Appending operator for integers. |
|
Appending operator for single characters. |
|
Appending operator for strings.
|
|
Stream style appending operator for booleans |
|
Stream style appending operator for unsigned integers |
|
Stream style appending operator for integers |
|
Stream style appending operator for single characters |
|
Stream style appending operator for C strings |
|
Assignment operator for booleans. |
|
Assignment operator for unsigned integers. |
|
Assignment operator for integers. |
|
Assignment operator for single characters. |
|
Assignment from char* operator.
Reimplemented in Regexp, NamedString, URI, and Message. |
|
Assignment from String* operator.
|
|
Assignment operator. Reimplemented in URI, and Configuration. |
|
Fast equality operator. |
|
Equality operator. |
|
Stream style extraction operator for booleans |
|
Stream style extraction operator for unsigned integers |
|
Stream style extraction operator for integers |
|
Stream style extraction operator for single characters |
|
Stream style substring skipping operator. It eats all characters up to and including the skip string |
|
Indexing operator
|
|
Case-insensitive inequality operator. |
|
Create a string by replacing matched strings in a template
|
|
Locate the last instance of a character in the string
|
|
Get a valid non-NULL C string.
|
|
Splits the string at a delimiter character
|
|
Create an escaped string suitable for use in SQL queries
|
|
Create an escaped string suitable for use in SQL queries
|
|
Checks if the string starts with a substring and removes it
|
|
Checks if the string starts with a substring
|
|
Substring extraction
|
|
Convert the string to a boolean value.
|
|
Convert the string to a floating point value.
|
|
Convert the string to an integer value looking up first a token table.
|
|
Convert the string to an integer value.
|
|
Turn the string to an all-lowercase string
|
|
Override GenObject's method to return this String
Reimplemented from GenObject. Reimplemented in NamedString. |
|
Turn the string to an all-uppercase string
|
|
Strip off leading and trailing blank characters |
|
Create an escaped string suitable for use in URI
|
|
Create an escaped string suitable for use in URIs
|
|
Decode an URI escaped string back to its raw form
|
|
Decode an URI escaped string back to its raw form
|