#include <BasicString.h++>


Classes | |
| class | StringBuf |
Public Member Functions | |
| BasicString () | |
| Construct a new, empty string. | |
| BasicString (T *str, size_t offset=0, size_t length=0, bool copy=true) | |
| Construct a new string from a C string. | |
| BasicString (const BasicString< T > &other) | |
| Copy constructor. | |
| BasicString (const T *other, size_t offset=0, size_t length=0) | |
| Construct a new string from a C string. | |
| BasicString (const byte_t *data, size_t length, const char *encoding) | |
| Construct a new string from a byte array. | |
| virtual | ~BasicString () throw () |
| Destructor. | |
| bool | endsWith (const BasicString< T > &str, bool ignoreCase=false) const throw () |
| Test if the string ends with the given string. | |
| bool | endsWith (T c, bool ignoreCase=false) const throw () |
| Test if the string ends with the given character. | |
| bool | endsWithAnyOf (const T *chars, bool ignoreCase=false) const throw () |
| Test if the string ends with any character in a given set of characters. | |
| bool | startsWith (const BasicString< T > &str, bool ignoreCase=false) const throw () |
| Test if the string starts with the given string. | |
| bool | startsWith (T c, bool ignoreCase=false) const throw () |
| Test if the string starts with the given character. | |
| bool | startsWithAnyOf (const T *chars, bool ignoreCase=false) const throw () |
| Test if the string starts with any character in a given set of characters. | |
| size_t | getLength () const throw () |
| Get the length of the string. | |
| size_t | length () const throw () |
| Get the length of the string. | |
| void | setLength (uint_t length) |
| Set the length of the string. | |
| void | reserve (uint_t capacity) |
| Reserve space in the string for the given number of characters. | |
| size_t | getCapacity () const throw () |
| Get the current capacity of the string, in characters. | |
| void | compact () |
| Compact the string so that it occupies the minimum amount of memory required. | |
| BasicString< T > & | clear () |
| Clear the string. | |
| bool | isEmpty () const throw () |
| Test if the string is empty. | |
| bool | isNull () const throw () |
| Test if the string is null. | |
| bool | isAlphaNumeric () const throw () |
| Test if the string consists solely of alphanumeric characters (A-Z, a-z, and 0-9). | |
| bool | isInteger () const throw () |
| Test if the string holds an integer. | |
| int | compareTo (const T *other, bool ignoreCase=false) const throw () |
| Compare the string to another. | |
| int | compareTo (const BasicString< T > &other, bool ignoreCase=false) const throw () |
| Compare the string to another. | |
| BasicString< T > & | trim (const T *chars=whitespaceChars, bool begin=true, bool end=true) |
| Trim leading and trailing characters from the string. | |
| BasicString< T > & | trimBegin (const T *chars=whitespaceChars) |
| Trim characters from the beginning of the string. | |
| BasicString< T > & | trimEnd (const T *chars=whitespaceChars) |
| Trim characters from the end of the string. | |
| BasicString< T > & | chop (T c) |
| Truncate the string at the first occurrence of the given character. | |
| BasicString< T > & | reverseChop (T c) |
| Truncate the string at the last occurrence of the given character. | |
| BasicString< T > & | replace (T a, T b) |
| Replace all occurences of one character with another. | |
| BasicString< T > & | replace (const BasicString< T > &a, const BasicString< T > &b) |
| Replace all occurences of one substring with another. | |
| BasicString< T > & | replace (const T *a, const T *b) |
| Replace all occurences of one substring with another. | |
| BasicString< T > & | printf (const T *format,...) |
| Append a C-style formatted string to the string. | |
| BasicString< T > & | insert (T c, uint_t index=0) |
| Insert a character into the string. | |
| BasicString< T > & | insert (const T *str, uint_t index=0, size_t length=0) |
| Insert a string into this string. | |
| BasicString< T > & | insert (const BasicString< T > &str, uint_t index=0, size_t length=0) |
| Insert a string into this string. | |
| BasicString< T > & | insert (const std::basic_string< T > &str, uint_t index=0, size_t length=0) |
| Insert a string into this string. | |
| BasicString< T > & | append (bool v) |
| Append a string representation of a boolean value to the end of the string. | |
| BasicString< T > & | append (int val) |
| Append a string representation of an integer value onto the end of the string. | |
| BasicString< T > & | append (int val, uint_t base) |
| Append a string representation of an integer value in the given base onto the end of the string. | |
| BasicString< T > & | append (uint_t val) |
| Append a string representation of an unsigned integer value onto the end of the string. | |
| BasicString< T > & | append (uint_t val, uint_t base) |
| Append a string representation of an unsigned integer value in the given base onto the end of the string. | |
| BasicString< T > & | append (int64_t val) |
| Append a string representation of a long long (64-bit) integer onto the end of the string. | |
| BasicString< T > & | append (double val, uint_t precision=6) |
| Append a string representation of double-precision floating point value onto the end of the string. | |
| BasicString< T > & | append (uint64_t val) |
| Append a string representation of an unsigned long long (64-bit) integer onto the end of the string. | |
| BasicString< T > & | append (T c) |
| Append a character to the end of the string. | |
| BasicString< T > & | append (const T *str, size_t length=0) |
| Append a string to the end of the string. | |
| BasicString< T > & | append (const BasicString< T > &str, size_t length=0) |
| Append a string to the end of the string. | |
| BasicString< T > & | append (const std::basic_string< T > &str, size_t length=0) |
| Append a string to the end of the string. | |
| BasicString< T > & | prepend (T c) |
| Prepend a character to the beginning of the string. | |
| BasicString< T > & | prepend (const T *str, size_t length=0) |
| Prepend a string to the beginning of the string. | |
| BasicString< T > & | prepend (const BasicString< T > &str, size_t length=0) |
| Prepend a string to the beginning of the string. | |
| BasicString< T > & | prepend (const std::basic_string< T > &str, size_t length=0) |
| Prepend a string to the beginning of the string. | |
| BasicString< T > & | remove (uint_t fromIndex, uint_t toIndex=END) |
| Remove a portion of the string. | |
| uint_t | hash (uint_t modulo=256) const throw () |
| Compute a hashcode for the string. | |
| BasicString< T > | substring (uint_t fromIndex, uint_t toIndex=END) const |
| Extract a substring from the string. | |
| int | indexOf (T c, uint_t fromIndex=0) const throw () |
| Find the first occurrence of a given character in the string. | |
| int | indexOf (const T *str, uint_t fromIndex=0) const throw () |
| Find the first occurrence of a given string in this string. | |
| int | indexOfAnyOf (const T *chars, uint_t fromIndex=0) const throw () |
| Find the first occurrence in this string of any character in a set of characters. | |
| int | indexOf (const BasicString< T > &str, uint_t fromIndex=0) const throw () |
| Find the first occurrence of a given string in this string. | |
| int | indexOf (const std::basic_string< T > &str, uint_t fromIndex=0) const throw () |
| Find the first occurrence of a given string in this string. | |
| int | lastIndexOf (T c, uint_t fromIndex=END) const throw () |
| Find the last occurrence of a given character in this string. | |
| int | lastIndexOfAnyOf (const T *chars, uint_t fromIndex=END) const throw () |
| Find the last occurrence in the string of any character in a set of characters. | |
| int | lastIndexOf (const T *str, uint_t fromIndex=END) const throw () |
| Find the last occurrence of a given string in this string. | |
| int | lastIndexOf (const BasicString< T > &str, uint_t fromIndex=END) const throw () |
| Find the last occurrence of a given string in this string. | |
| int | lastIndexOf (const std::basic_string< T > &str, uint_t fromIndex=END) const throw () |
| Find the last occurrence of a given string in this string. | |
| bool | contains (T c) const throw () |
| Determine if the string contains a given character. | |
| bool | containsAnyOf (const T *chars) const throw () |
| Determine if the string contains any character in a given set of characters. | |
| bool | contains (const T *str) const throw () |
| Determine if the string contains a given substring. | |
| bool | contains (const BasicString< T > &str) const throw () |
| Determine if the string contains a given substring. | |
| bool | contains (const std::basic_string< T > &str) const throw () |
| Determine if the string contains a given substring. | |
| BasicString< T > | nextToken (uint_t &fromIndex, const T *delim=whitespaceChars) const |
| Extract a token from the string. | |
| uint_t | split (BasicStringVec< T > &tokens, const T *delim=whitespaceChars, uint_t limit=0) const |
| Split the string into a series of tokens, without modifying the string. | |
| BasicString< T > & | toLowerCase () |
| Convert the string to lower case. | |
| BasicString< T > & | toUpperCase () |
| Convert the string to upper case. | |
| BasicString< T > & | fill (T c, size_t length) |
| Fill the string with a character. | |
| BasicString< T > & | pad (T c, size_t length) |
| Pad the string with a character. | |
| bool | toBool (uint_t index=0) const throw () |
| Parse a boolean value from the string. | |
| int | toInt (uint_t index=0, uint_t base=10) const throw () |
| Parse an integer from the string. | |
| uint_t | toUInt (uint_t index=0, uint_t base=10) const throw () |
| Parse an unsigned integer from the string. | |
| int64_t | toInt64 (uint_t index=0, uint_t base=10) const throw () |
| Parse a 64-bit integer from the string. | |
| uint64_t | toUInt64 (uint_t index=0, uint_t base=10) const throw () |
| Parse an unsigned 64-bit integer from the string. | |
| float | toFloat (uint_t index=0) const throw () |
| Parse a floating point value from the string. | |
| double | toDouble (uint_t index=0) const throw () |
| Parse a double precision floating point value from the string. | |
| operator const void * () const throw () | |
| Pointer cast operator. | |
| const T * | c_str () const throw () |
| Return the contents of the string as an immutable C string. | |
| Blob | getBytes (const char *encoding, size_t length=0, size_t maxEncodedLength=0) const |
| Encode the string using the specified character encoding, returning the results as a Blob. | |
| BasicString< T > & | operator= (const T *other) |
| Assignment operator. | |
| BasicString< T > & | operator= (const BasicString< T > &other) |
| Assignment operator. | |
| BasicString< T > & | operator= (const std::basic_string< T > &other) |
| Assignment operator. | |
| T & | operator[] (int index) throw (OutOfBoundsException) |
| Array index operator. | |
| BasicChar< T > | operator[] (int index) const throw (OutOfBoundsException) |
| Array index operator. | |
| BasicString< T > | operator() (uint_t fromIndex, uint_t toIndex=END) const |
| Substring operator. | |
| bool | operator! () const throw () |
| Unary NOT operator. | |
| BasicString< T > & | operator+= (T c) |
| Append a character onto the end of the string. | |
| BasicString< T > & | operator+= (const T *str) |
| Append a string onto the end of this string. | |
| BasicString< T > & | operator+= (const BasicString< T > &str) |
| Append a string onto the end of this string. | |
| BasicString< T > & | operator+= (const std::basic_string< T > &str) |
| Append a string onto the end of this string. | |
| BasicString< T > & | operator+= (bool val) |
| Append a string representation of a boolean value onto the end of the string. | |
| BasicString< T > & | operator+= (int val) |
| Append a string representation of an integer value onto the end of the string. | |
| BasicString< T > & | operator+= (uint_t val) |
| Append a string representation of an unsigned integer value onto the end of the string. | |
| BasicString< T > & | operator+= (double val) |
| Append a string representation of double-precision floating point value onto the end of the string. | |
| BasicString< T > & | operator+= (int64_t val) |
| Append a string representation of a long long (64-bit) integer onto the end of the string. | |
| BasicString< T > & | operator+= (uint64_t val) |
| Append a string representation of an unsigned long long (64-bit) integer onto the end of the string. | |
| BasicString< T > & | operator<< (const T *str) |
| Append operator. | |
| BasicString< T > & | operator<< (const BasicString< T > &str) |
| Append operator. | |
| BasicString< T > & | operator<< (const std::basic_string< T > &str) |
| Append operator. | |
| BasicString< T > & | operator<< (bool val) |
| Append operator. | |
| BasicString< T > & | operator<< (T c) |
| Append operator. | |
| BasicString< T > & | operator<< (int val) |
| Append operator. | |
| BasicString< T > & | operator<< (uint_t val) |
| Append operator. | |
| BasicString< T > & | operator<< (int64_t val) |
| Append operator. | |
| BasicString< T > & | operator<< (uint64_t val) |
| Append operator. | |
| BasicString< T > & | operator<< (double val) |
| Append operator. | |
| BasicString< T > & | operator^= (T c) |
| Prepend operator. | |
| BasicString< T > & | operator^= (const T *str) |
| Prepend operator. | |
| BasicString< T > & | operator^= (const BasicString< T > &str) |
| Prepend operator. | |
| BasicString< T > & | operator^= (const std::basic_string< T > &str) |
| Prepend operator. | |
| BasicString< T > | operator+ (const BasicString< T > &str) |
| BasicString< T > | operator+ (const T *str) |
| BasicString< T > | operator+ (T c) |
Static Public Member Functions | |
| static BasicString< T > | fromCharArray (const char *str, size_t length=0) |
| Create a string from the given character array. | |
| static BasicString< T > | fromUTF8 (const char *str) |
| Create a string from the given UTF-8 character array. | |
| static BasicString< T > | fromWCharArray (const wchar_t *str, size_t length=0) |
| Create a string from the given wide character array. | |
Static Public Attributes | |
| static const uint_t | END = BasicCharTraits<T>::END |
| A pseudo-index indicating the end of the string. | |
| static const BasicString< T > | null = BasicCharTraits<T>::null() |
| The null string. | |
| static const BasicString< T > | empty = BasicCharTraits<T>::empty() |
| The empty string. | |
| static const T * | whitespaceChars = BasicCharTraits<T>::whitespace() |
| The set of whitespace delimiter characters. | |
| BasicString | ( | ) | [inline] |
Construct a new, empty string.
| BasicString | ( | T * | str, | |
| size_t | offset = 0, |
|||
| size_t | length = 0, |
|||
| bool | copy = true | |||
| ) | [inline] |
Construct a new string from a C string.
| str | The C string to copy or inherit. | |
| offset | The number of characters from the beginning of the string to skip over. | |
| length | The number of characters from the offset to use, or 0 to use all the characters to the end of the string. | |
| copy | If true, the C string is copied into the BasicString; otherwise the C string is inherited and the length parameter is ignored. |
| BasicString | ( | const BasicString< T > & | other | ) | [inline] |
Copy constructor.
| BasicString | ( | const T * | other, | |
| size_t | offset = 0, |
|||
| size_t | length = 0 | |||
| ) | [inline] |
Construct a new string from a C string.
| other | The C string to copy. | |
| offset | The number of characters from the beginning of the string to skip over. | |
| length | The number of characters from the offset to copy, or 0 to copy to the end of the string. |
| BasicString | ( | const byte_t * | data, | |
| size_t | length, | |||
| const char * | encoding | |||
| ) | [inline] |
Construct a new string from a byte array.
| data | The byte array. | |
| length | The length of the array. | |
| encoding | The character encoding of the data in the array. |
| ~BasicString | ( | ) | throw () [inline, virtual] |
Destructor.
| BasicString<T>& append | ( | const std::basic_string< T > & | str, | |
| size_t | length = 0 | |||
| ) | [inline] |
Append a string to the end of the string.
| str | The character to append. | |
| length | The maximum number of characters from str to append, or 0 to append all of str. |
| BasicString<T>& append | ( | const BasicString< T > & | str, | |
| size_t | length = 0 | |||
| ) | [inline] |
Append a string to the end of the string.
| str | The character to append. | |
| length | The maximum number of characters from str to append, or 0 to append all of str. |
| BasicString<T>& append | ( | const T * | str, | |
| size_t | length = 0 | |||
| ) | [inline] |
Append a string to the end of the string.
| str | The character to append. | |
| length | The maximum number of characters from str to append, or 0 to append all of str. |
| BasicString<T>& append | ( | T | c | ) | [inline] |
Append a character to the end of the string.
| c | The character to append. |
| BasicString< T > & append | ( | uint64_t | val | ) | [inline] |
Append a string representation of an unsigned long long (64-bit) integer onto the end of the string.
| val | The value to append. |
| BasicString< T > & append | ( | double | val, | |
| uint_t | precision = 6 | |||
| ) | [inline] |
Append a string representation of double-precision floating point value onto the end of the string.
| val | The value to append. | |
| precision | The precision (the number of digits to include after the radix). |
| BasicString< T > & append | ( | int64_t | val | ) | [inline] |
Append a string representation of a long long (64-bit) integer onto the end of the string.
| val | The value to append. |
| BasicString< T > & append | ( | uint_t | val, | |
| uint_t | base | |||
| ) | [inline] |
Append a string representation of an unsigned integer value in the given base onto the end of the string.
| val | The value to append. | |
| base | The numerical base in which to output the value. The valid range is 2 - 36, inclusive. |
| BasicString< T > & append | ( | uint_t | val | ) | [inline] |
Append a string representation of an unsigned integer value onto the end of the string.
| val | The value to append. |
| BasicString< T > & append | ( | int | val, | |
| uint_t | base | |||
| ) | [inline] |
Append a string representation of an integer value in the given base onto the end of the string.
| val | The value to append. | |
| base | The numerical base in which to output the value. The valid range is 2 - 36, inclusive. |
| BasicString< T > & append | ( | int | val | ) | [inline] |
Append a string representation of an integer value onto the end of the string.
| val | The value to append. |
| BasicString< T > & append | ( | bool | v | ) | [inline] |
Append a string representation of a boolean value to the end of the string.
| v | The value to append. |
| const T * c_str | ( | ) | const throw () [inline] |
Return the contents of the string as an immutable C string.
| BasicString< T > & chop | ( | T | c | ) | [inline] |
Truncate the string at the first occurrence of the given character.
| c | The character at which to truncate. |
| BasicString<T>& clear | ( | ) | [inline] |
Clear the string.
Sets the length of the string to 0.
| void compact | ( | ) | [inline] |
Compact the string so that it occupies the minimum amount of memory required.
| int compareTo | ( | const BasicString< T > & | other, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Compare the string to another.
| other | The string to compare to. | |
| ignoreCase | A flag indicating whether the compare should be case insensitive. |
| int compareTo | ( | const T * | other, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Compare the string to another.
| other | The string to compare to. | |
| ignoreCase | A flag indicating whether the compare should be case insensitive. |
| bool contains | ( | const std::basic_string< T > & | str | ) | const throw () [inline] |
Determine if the string contains a given substring.
| str | The substring to search for. |
| bool contains | ( | const BasicString< T > & | str | ) | const throw () [inline] |
Determine if the string contains a given substring.
| str | The substring to search for. |
| bool contains | ( | const T * | str | ) | const throw () [inline] |
Determine if the string contains a given substring.
| str | The substring to search for. |
| bool contains | ( | T | c | ) | const throw () [inline] |
Determine if the string contains a given character.
| c | The character to search for. |
| bool containsAnyOf | ( | const T * | chars | ) | const throw () [inline] |
Determine if the string contains any character in a given set of characters.
| chars | The set of characters. |
| bool endsWith | ( | T | c, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Test if the string ends with the given character.
| c | The character. | |
| ignoreCase | A flag indicating whether the comparison should be case-insensitive. |
| bool endsWith | ( | const BasicString< T > & | str, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Test if the string ends with the given string.
| str | The other string. | |
| ignoreCase | A flag indicating whether the comparison should be case-insensitive. |
| bool endsWithAnyOf | ( | const T * | chars, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Test if the string ends with any character in a given set of characters.
| chars | The set of characters. | |
| ignoreCase | A flag indicating whether the comparison should be case-insensitive. |
| BasicString< T > & fill | ( | T | c, | |
| size_t | length | |||
| ) | [inline] |
Fill the string with a character.
| c | The fill character. | |
| length | The number of characters to fill. |
| BasicString< T > fromCharArray | ( | const char * | str, | |
| size_t | length = 0 | |||
| ) | [inline, static] |
Create a string from the given character array.
| BasicString< T > fromUTF8 | ( | const char * | str | ) | [inline, static] |
Create a string from the given UTF-8 character array.
| BasicString< T > fromWCharArray | ( | const wchar_t * | str, | |
| size_t | length = 0 | |||
| ) | [inline, static] |
Create a string from the given wide character array.
| Blob getBytes | ( | const char * | encoding, | |
| size_t | length = 0, |
|||
| size_t | maxEncodedLength = 0 | |||
| ) | const [inline] |
Encode the string using the specified character encoding, returning the results as a Blob.
| encoding | The character encoding to use. | |
| length | The number of characters to encode, or 0 to encode the entire string. | |
| maxEncodedLength | The maximum number of bytes to encode, or 0 if there is no limit. If a limit is specified, no more complete characters will be encoded than would fit in the specified number of bytes. |
| size_t getCapacity | ( | ) | const throw () [inline] |
Get the current capacity of the string, in characters.
This value takes into account the space required for the final NUL terminator.
| size_t getLength | ( | ) | const throw () [inline] |
Compute a hashcode for the string.
| modulo | The desired range for the hashcode. |
| int indexOf | ( | const std::basic_string< T > & | str, | |
| uint_t | fromIndex = 0 | |||
| ) | const throw () [inline] |
Find the first occurrence of a given string in this string.
| str | The string to search for. | |
| fromIndex | The start index from which to begin searching. |
| int indexOf | ( | const BasicString< T > & | str, | |
| uint_t | fromIndex = 0 | |||
| ) | const throw () [inline] |
Find the first occurrence of a given string in this string.
| str | The string to search for. | |
| fromIndex | The start index from which to begin searching. |
| int indexOf | ( | const T * | str, | |
| uint_t | fromIndex = 0 | |||
| ) | const throw () [inline] |
Find the first occurrence of a given string in this string.
| str | The string to search for. | |
| fromIndex | The start index from which to begin searching. |
| int indexOf | ( | T | c, | |
| uint_t | fromIndex = 0 | |||
| ) | const throw () [inline] |
Find the first occurrence of a given character in the string.
| c | The character to search for. | |
| fromIndex | The start index from which to begin searching. |
| int indexOfAnyOf | ( | const T * | chars, | |
| uint_t | fromIndex = 0 | |||
| ) | const throw () [inline] |
Find the first occurrence in this string of any character in a set of characters.
| chars | The set of characters search for. | |
| fromIndex | The start index from which to begin searching. |
| BasicString<T>& insert | ( | const std::basic_string< T > & | str, | |
| uint_t | index = 0, |
|||
| size_t | length = 0 | |||
| ) | [inline] |
Insert a string into this string.
| str | The string to insert. | |
| index | The index at which to insert the string. If the index is out of range, the string is appended to the end of this string. | |
| length | The maximum number of characters from str to insert. |
| BasicString< T > & insert | ( | const BasicString< T > & | str, | |
| uint_t | index = 0, |
|||
| size_t | length = 0 | |||
| ) | [inline] |
Insert a string into this string.
| str | The string to insert. | |
| index | The index at which to insert the string. If the index is out of range, the string is appended to the end of this string. | |
| length | The maximum number of characters from str to insert. |
| BasicString< T > & insert | ( | const T * | str, | |
| uint_t | index = 0, |
|||
| size_t | length = 0 | |||
| ) | [inline] |
Insert a string into this string.
| str | The string to insert. | |
| index | The index at which to insert the string. If the index is out of range, the string is appended to the end of this string. | |
| length | The maximum number of characters from str to insert. |
| BasicString< T > & insert | ( | T | c, | |
| uint_t | index = 0 | |||
| ) | [inline] |
Insert a character into the string.
| c | The character to insert. | |
| index | The index at which to insert the character. If the index is out of range, the character is appended to the end of the string. |
| bool isAlphaNumeric | ( | ) | const throw () [inline] |
Test if the string consists solely of alphanumeric characters (A-Z, a-z, and 0-9).
| bool isEmpty | ( | ) | const throw () [inline] |
Test if the string is empty.
| bool isInteger | ( | ) | const throw () [inline] |
Test if the string holds an integer.
For example, "123", "+5", and "-123" are integers.
| bool isNull | ( | ) | const throw () [inline] |
Test if the string is null.
| int lastIndexOf | ( | const std::basic_string< T > & | str, | |
| uint_t | fromIndex = END | |||
| ) | const throw () [inline] |
Find the last occurrence of a given string in this string.
| str | The string to search for. | |
| fromIndex | The index from which to begin searching backwards, or END to start at the end of the string. |
| int lastIndexOf | ( | const BasicString< T > & | str, | |
| uint_t | fromIndex = END | |||
| ) | const throw () [inline] |
Find the last occurrence of a given string in this string.
| str | The string to search for. | |
| fromIndex | The index from which to begin searching backwards, or END to start at the end of the string. |
Find the last occurrence of a given string in this string.
| str | The string to search for. | |
| fromIndex | The index from which to begin searching backwards, or END to start at the end of the string. |
Find the last occurrence of a given character in this string.
| c | The character to search for. | |
| fromIndex | The index from which to begin searching backwards, or END to start at the end of the string. |
Find the last occurrence in the string of any character in a set of characters.
| chars | The set of characters search for. | |
| fromIndex | The index from which to begin searching backwards, or END to start at the end of the string. |
| size_t length | ( | ) | const throw () [inline] |
Get the length of the string.
| BasicString< T > nextToken | ( | uint_t & | fromIndex, | |
| const T * | delim = whitespaceChars | |||
| ) | const [inline] |
Extract a token from the string.
| fromIndex | The start index at which to begin searching for a token. Will be modified on return to point to one character past the extracted token. | |
| delim | The set of possible token delimiter characters (the set of whitespace characters by default). |
| operator const void * | ( | ) | const throw () [inline] |
Pointer cast operator.
| bool operator! | ( | ) | const throw () [inline] |
Unary NOT operator.
| BasicString<T> operator() | ( | uint_t | fromIndex, | |
| uint_t | toIndex = END | |||
| ) | const [inline] |
Substring operator.
Extract a substring from the string.
| fromIndex | The start index of the substring. | |
| toIndex | The end index of the substring, or END to indicate the end of the string. |
| BasicString< T > operator+ | ( | T | c | ) | [inline] |
| BasicString< T > operator+ | ( | const T * | str | ) | [inline] |
| BasicString< T > operator+ | ( | const BasicString< T > & | str | ) | [inline] |
| BasicString<T>& operator+= | ( | uint64_t | val | ) | [inline] |
Append a string representation of an unsigned long long (64-bit) integer onto the end of the string.
| val | The value to append. |
| BasicString<T>& operator+= | ( | int64_t | val | ) | [inline] |
Append a string representation of a long long (64-bit) integer onto the end of the string.
| val | The value to append. |
| BasicString<T>& operator+= | ( | double | val | ) | [inline] |
Append a string representation of double-precision floating point value onto the end of the string.
| val | The value to append. |
| BasicString<T>& operator+= | ( | uint_t | val | ) | [inline] |
Append a string representation of an unsigned integer value onto the end of the string.
| val | The value to append. |
| BasicString<T>& operator+= | ( | int | val | ) | [inline] |
Append a string representation of an integer value onto the end of the string.
| val | The value to append. |
| BasicString<T>& operator+= | ( | bool | val | ) | [inline] |
Append a string representation of a boolean value onto the end of the string.
| val | The value to append. |
| BasicString<T>& operator+= | ( | const std::basic_string< T > & | str | ) | [inline] |
Append a string onto the end of this string.
| str | The string to append. |
| BasicString<T>& operator+= | ( | const BasicString< T > & | str | ) | [inline] |
Append a string onto the end of this string.
| str | The string to append. |
| BasicString<T>& operator+= | ( | const T * | str | ) | [inline] |
Append a string onto the end of this string.
| str | The string to append. |
| BasicString<T>& operator+= | ( | T | c | ) | [inline] |
Append a character onto the end of the string.
| c | The character to append. |
| BasicString<T>& operator<< | ( | double | val | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | uint64_t | val | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | int64_t | val | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | uint_t | val | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | int | val | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | T | c | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | bool | val | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | const std::basic_string< T > & | str | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | const BasicString< T > & | str | ) | [inline] |
Append operator.
| BasicString<T>& operator<< | ( | const T * | str | ) | [inline] |
Append operator.
| BasicString<T>& operator= | ( | const std::basic_string< T > & | other | ) | [inline] |
Assignment operator.
| BasicString< T > & operator= | ( | const BasicString< T > & | other | ) | [inline] |
Assignment operator.
| BasicString< T > & operator= | ( | const T * | other | ) | [inline] |
Assignment operator.
| BasicChar< T > operator[] | ( | int | index | ) | const throw (OutOfBoundsException) [inline] |
Array index operator.
Obtain a copy of the character at the given offset in the string.
| index | The index. |
| OutOfBoundsException | If index is out of range. |
| T & operator[] | ( | int | index | ) | throw (OutOfBoundsException) [inline] |
Array index operator.
Obtain a reference to the character at the given offset in the string.
| index | The index. |
| OutOfBoundsException | If index is out of range. |
| BasicString<T>& operator^= | ( | const std::basic_string< T > & | str | ) | [inline] |
Prepend operator.
| BasicString<T>& operator^= | ( | const BasicString< T > & | str | ) | [inline] |
Prepend operator.
| BasicString<T>& operator^= | ( | const T * | str | ) | [inline] |
Prepend operator.
| BasicString<T>& operator^= | ( | T | c | ) | [inline] |
Prepend operator.
| BasicString< T > & pad | ( | T | c, | |
| size_t | length | |||
| ) | [inline] |
Pad the string with a character.
| c | The pad character. | |
| length | The number of characters to pad. |
| BasicString<T>& prepend | ( | const std::basic_string< T > & | str, | |
| size_t | length = 0 | |||
| ) | [inline] |
Prepend a string to the beginning of the string.
| str | The character to prepend. | |
| length | The maximum number of characters from str to prepend, or 0 to prepend all of str. |
| BasicString<T>& prepend | ( | const BasicString< T > & | str, | |
| size_t | length = 0 | |||
| ) | [inline] |
Prepend a string to the beginning of the string.
| str | The character to prepend. | |
| length | The maximum number of characters from str to prepend, or 0 to prepend all of str. |
| BasicString<T>& prepend | ( | const T * | str, | |
| size_t | length = 0 | |||
| ) | [inline] |
Prepend a string to the beginning of the string.
| str | The character to prepend. | |
| length | The maximum number of characters from str to prepend, or 0 to prepend all of str. |
| BasicString<T>& prepend | ( | T | c | ) | [inline] |
Prepend a character to the beginning of the string.
| c | The character to prepend. |
| BasicString< T > & printf | ( | const T * | format, | |
| ... | ||||
| ) | [inline] |
Append a C-style formatted string to the string.
The functionality is equivalent to that of sprintf().
| format | The format string. |
| BasicString< T > & remove | ( | uint_t | fromIndex, | |
| uint_t | toIndex = END | |||
| ) | [inline] |
Remove a portion of the string.
| fromIndex | The start index of the range to remove. | |
| toIndex | The end index of the range to remove, or END to remove to the end of the string. |
| BasicString< T > & replace | ( | const T * | a, | |
| const T * | b | |||
| ) | [inline] |
Replace all occurences of one substring with another.
| a | The substring to replace. | |
| b | The replacement substring. |
| BasicString<T>& replace | ( | const BasicString< T > & | a, | |
| const BasicString< T > & | b | |||
| ) | [inline] |
Replace all occurences of one substring with another.
| a | The substring to replace. | |
| b | The replacement substring. |
| BasicString< T > & replace | ( | T | a, | |
| T | b | |||
| ) | [inline] |
Replace all occurences of one character with another.
| a | The character to replace. | |
| b | The replacement character. |
| void reserve | ( | uint_t | capacity | ) | [inline] |
Reserve space in the string for the given number of characters.
If the new capacity is less than or equal to the current capacity, the string is not modified.
| capacity | The new capacity. |
| BasicString< T > & reverseChop | ( | T | c | ) | [inline] |
Truncate the string at the last occurrence of the given character.
| c | The character at which to truncate. |
| void setLength | ( | uint_t | length | ) | [inline] |
Set the length of the string.
Allows the string to be truncated to an arbitrary length.
| length | The new length. The new length must be less than the current length; otherwise the string is left unmodified. |
| uint_t split | ( | BasicStringVec< T > & | tokens, | |
| const T * | delim = whitespaceChars, |
|||
| uint_t | limit = 0 | |||
| ) | const [inline] |
Split the string into a series of tokens, without modifying the string.
| tokens | The vector in which to place the extracted tokens. If a non-empty vector is supplied, the tokens are added to the end of the vector. | |
| delim | The set of possible token delimiter characters (the set of whitespace characters by default). | |
| limit | The maximum number of tokens to extract, or 0 for no limit (the default). |
| bool startsWith | ( | T | c, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Test if the string starts with the given character.
| c | The character. | |
| ignoreCase | A flag indicating whether the comparison should be case-insensitive. |
| bool startsWith | ( | const BasicString< T > & | str, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Test if the string starts with the given string.
| str | The other string. | |
| ignoreCase | A flag indicating whether the comparison should be case-insensitive. |
| bool startsWithAnyOf | ( | const T * | chars, | |
| bool | ignoreCase = false | |||
| ) | const throw () [inline] |
Test if the string starts with any character in a given set of characters.
| chars | The set of characters. | |
| ignoreCase | A flag indicating whether the comparison should be case-insensitive. |
| BasicString< T > substring | ( | uint_t | fromIndex, | |
| uint_t | toIndex = END | |||
| ) | const [inline] |
Extract a substring from the string.
| fromIndex | The start index of the substring. | |
| toIndex | The end index of the substring, or END to indicate the end of the string. |
| bool toBool | ( | uint_t | index = 0 |
) | const throw () [inline] |
Parse a boolean value from the string.
| index | The index to begin parsing at. |
| double toDouble | ( | uint_t | index = 0 |
) | const throw () [inline] |
Parse a double precision floating point value from the string.
| index | The index to begin parsing at. |
| float toFloat | ( | uint_t | index = 0 |
) | const throw () [inline] |
Parse a floating point value from the string.
| index | The index to begin parsing at. |
Parse an integer from the string.
| index | The index to begin parsing at. | |
| base | The base (2 - 36). |
Parse a 64-bit integer from the string.
| index | The index to begin parsing at. | |
| base | The base (2 - 36). |
| BasicString< T > & toLowerCase | ( | ) | [inline] |
Convert the string to lower case.
Parse an unsigned integer from the string.
| index | The index to begin parsing at. | |
| base | The base (2 - 36). |
Parse an unsigned 64-bit integer from the string.
| index | The index to begin parsing at. | |
| base | The base (2 - 36). |
| BasicString< T > & toUpperCase | ( | ) | [inline] |
Convert the string to upper case.
| BasicString< T > & trim | ( | const T * | chars = whitespaceChars, |
|
| bool | begin = true, |
|||
| bool | end = true | |||
| ) | [inline] |
Trim leading and trailing characters from the string.
| BasicString<T>& trimBegin | ( | const T * | chars = whitespaceChars |
) | [inline] |
Trim characters from the beginning of the string.
| chars | The set of characters to trim (the set of whitespace characters by default). |
| BasicString<T>& trimEnd | ( | const T * | chars = whitespaceChars |
) | [inline] |
Trim characters from the end of the string.
| chars | The set of characters to trim (the set of whitespace characters by default). |
const BasicString< T > empty = BasicCharTraits<T>::empty() [inline, static] |
The empty string.
const uint_t END = BasicCharTraits<T>::END [inline, static] |
A pseudo-index indicating the end of the string.
const BasicString< T > null = BasicCharTraits<T>::null() [inline, static] |
The null string.
const T * whitespaceChars = BasicCharTraits<T>::whitespace() [inline, static] |
The set of whitespace delimiter characters.
1.5.9