#include <BasicCharTraits.h++>
Static Public Member Functions | |
| static size_t | length (const T *str) throw () |
| Get the length of a string. | |
| static T * | copy (T *dest, const T *src, size_t n) throw () |
| Copy a string. | |
| static T * | rawCopy (T *dest, const T *src, size_t n) throw () |
| Copy a fixed number of characters. | |
| static T * | concat (T *dest, const T *src, size_t n) throw () |
| Concatenate a string onto another string. | |
| static T * | move (T *dest, T *src, size_t n) throw () |
| Copy a string to a possibly overlapping destination string. | |
| static int | compare (const T *str1, const T *str2, bool ignoreCase=false) throw () |
| Compare two strings. | |
| static int | rawCompare (const T *str1, const T *str2, size_t n) throw () |
| Compare two strings. | |
| static int | collate (const T *str1, const T *str2) throw () |
| Lexicographically compare two strings based on the collation rules of the current locale. | |
| static int | compare (const T *str1, const T *str2, size_t n, bool ignoreCase=false) throw () |
| Compare two strings. | |
| static int | compare (T c1, T c2, bool ignoreCase=false) throw () |
| Compare two characters. | |
| static size_t | span (const T *str, const T *accept) throw () |
| Calculate the length of the initial segment of a string which consists entirely of characters in the given set. | |
| static int32_t | toLong (const T *str, T **endptr=NULL, int base=10) throw () |
| Parse a long integer value from the string. | |
| static uint32_t | toULong (const T *str, T **endptr=NULL, int base=10) throw () |
| Parse an unsigned long integer value from the string. | |
| static int64_t | toLongLong (const T *str, T **endptr=NULL, int base=10) throw () |
| Parse a long long integer value from the string. | |
| static uint64_t | toULongLong (const T *str, T **endptr=NULL, int base=10) throw () |
| Parse an unsigned long long integer value from the string. | |
| static float | toFloat (const T *str, T **endptr=NULL) throw () |
| Parse a floating-point value from the string. | |
| static double | toDouble (const T *str, T **endptr=NULL) throw () |
| Parse a double-precision floating point value from the string. | |
| static T * | find (T *str, T c, size_t len=0) throw () |
| Find the first occurrence of a character in a string. | |
| static const T * | find (const T *str, T c, size_t len=0) throw () |
| Find the first occurrence of a character in a string. | |
| static T * | findLast (T *str, T c, uint_t fromIndex=END) throw () |
| Find the last occurrence of a character in a string. | |
| static const T * | findLast (const T *str, T c, uint_t fromIndex=END) throw () |
| Find the last occurrence of a character in a string. | |
| static T * | find (T *str, const T *s) throw () |
| Find the first occurrence of a substring in a string. | |
| static const T * | find (const T *str, const T *s) throw () |
| Find the first occurrence of a substring in a string. | |
| static T * | findLast (T *str, const T *s, uint_t fromIndex=END) throw () |
| Find the last occurrence of a substring in a string. | |
| static const T * | findLast (const T *str, const T *s, uint_t fromIndex=END) throw () |
| Find the last occurrence of a substring in a string. | |
| static int | printf (T *str, size_t len, const T *format,...) throw () |
| Write a formatted string. | |
| static int | vprintf (T *str, size_t len, const T *format, va_list vp) throw () |
| Write a formatted string. | |
| static T | nul () throw () |
| Return the NUL character. | |
| static T | plus () throw () |
| Return the '+' character. | |
| static T | minus () throw () |
| Return the '-' character. | |
| static const T * | null () throw () |
| Return a null string. | |
| static const T * | empty () throw () |
| Return an empty string. | |
| static const T * | whitespace () throw () |
| Return an array containing the set of whitespace characters. | |
| static const T * | digits () throw () |
| Return an array containing the set of digits used to represent numbers in base 2 through base 36 ('0' - '9' and 'A' - 'Z'). | |
| static const T * | nullRep () throw () |
| Return a string representation of the null string. | |
| static const T * | trueRep () throw () |
| Return a string representation of the boolean value true. | |
| static const T * | falseRep () throw () |
| Return a string representation of the boolean value false. | |
| static const T * | intFormat () throw () |
| Return the format string for integers. | |
| static const T * | uintFormat () throw () |
| Return the format string for unsigned integers. | |
| static const T * | int64Format () throw () |
| Return the compiler-specific format string for 64-bit integers. | |
| static const T * | uint64Format () throw () |
| Return the compiler-specific format string for unsigned 64-bit integers. | |
| static const T * | doubleFormat () throw () |
| Return the format string for double-precision floating point numbers with a parameterized precision. | |
| static bool | isAlpha (T c) throw () |
| Test if a character is alphabetic. | |
| static bool | isAlphaNumeric (T c) throw () |
| Test if a character is alphanumeric. | |
| static bool | isWhitespace (T c) throw () |
| Test if a character is whitespace. | |
| static bool | isPrintable (T c) throw () |
| Test if a character is printable. | |
| static bool | isGraphical (T c) throw () |
| Test if a character is graphical. | |
| static bool | isNul (T c) throw () |
| Test if a character is Nul. | |
| static bool | isControl (T c) throw () |
| Test if a character is a control character. | |
| static bool | isDigit (T c) throw () |
| Test if a character is a digit. | |
| static bool | isSign (T c) throw () |
| Test if a character is a sign symbol ('+' or '-'). | |
| static bool | isHexDigit (T c) throw () |
| Test if a character is a hexadecimal digit. | |
| static bool | isLowerCase (T c) throw () |
| Test if a character is lowercase. | |
| static bool | isUpperCase (T c) throw () |
| Test if a character is uppercase. | |
| static T | toUpperCase (T c) throw () |
| Get the uppercase equivalent of a character. | |
| static T | toLowerCase (T c) throw () |
| Get the lowercase equivalent of a character. | |
| static T | fromInt (int v) throw () |
| Convert an integer value in the range 0 - 9 to the corresponding digit character '0' - '9'. | |
| static int | toInt (T c) throw () |
| Convert a digit character in the range '0' - '9' to the corresponding integer value 0 - 9. | |
| static const char * | encoding () throw () |
| Get the character encoding used for the internal representation of a BasicString<T>. | |
Static Public Attributes | |
| static const uint_t | END = 0xFFFFFFFF |
| Pseudo-index indicating the end of the string. | |
This class is a collection of functions for performing various low level character-string operations.
| static int collate | ( | const T * | str1, | |
| const T * | str2 | |||
| ) | throw () [static] |
Lexicographically compare two strings based on the collation rules of the current locale.
| str1 | The first string. | |
| str2 | The second string. |
str1 < str2, a positive value if str1 > str2, and zero if the two strings are equal. | static int compare | ( | T | c1, | |
| T | c2, | |||
| bool | ignoreCase = false | |||
| ) | throw () [static] |
Compare two characters.
| c1 | The first character. | |
| c2 | The second character. | |
| ignoreCase | A flag indicating whether the comparison should be case-sensitive. |
c1 < c2, a positive value if c1 > c2, and zero if the two characters are equal. | static int compare | ( | const T * | str1, | |
| const T * | str2, | |||
| size_t | n, | |||
| bool | ignoreCase = false | |||
| ) | throw () [static] |
Compare two strings.
| str1 | The first string. | |
| str2 | The second string. | |
| n | The maximum number of characters to compare. | |
| ignoreCase | A flag indicating whether the comparison should be case-sensitive. |
str1 < str2, a positive value if str1 > str2, and zero if the two strings are equal. | static int compare | ( | const T * | str1, | |
| const T * | str2, | |||
| bool | ignoreCase = false | |||
| ) | throw () [static] |
Compare two strings.
| str1 | The first string. | |
| str2 | The second string. | |
| ignoreCase | A flag indicating whether the comparison should be case-sensitive. |
str1 < str2, a positive value if str1 > str2, and zero if the two strings are equal. | static T* concat | ( | T * | dest, | |
| const T * | src, | |||
| size_t | n | |||
| ) | throw () [static] |
Concatenate a string onto another string.
| dest | The destination string. | |
| src | The source string. | |
| n | The maximum number of characters to concatenate. |
| static T* copy | ( | T * | dest, | |
| const T * | src, | |||
| size_t | n | |||
| ) | throw () [static] |
Copy a string.
| dest | The destination string. | |
| src | The source string. | |
| n | The maximum number of characters to copy. |
| static const T* digits | ( | ) | throw () [static] |
Return an array containing the set of digits used to represent numbers in base 2 through base 36 ('0' - '9' and 'A' - 'Z').
| static const T* doubleFormat | ( | ) | throw () [static] |
Return the format string for double-precision floating point numbers with a parameterized precision.
Returns the string "%.*f".
| static const T* empty | ( | ) | throw () [static] |
Return an empty string.
| static const char* encoding | ( | ) | throw () [static] |
Get the character encoding used for the internal representation of a BasicString<T>.
| static const T* falseRep | ( | ) | throw () [static] |
Return a string representation of the boolean value false.
Returns the string "false".
| static const T* find | ( | const T * | str, | |
| const T * | s | |||
| ) | throw () [static] |
Find the first occurrence of a substring in a string.
| str | The string. | |
| s | The substring. |
| static T* find | ( | T * | str, | |
| const T * | s | |||
| ) | throw () [static] |
Find the first occurrence of a substring in a string.
| str | The string. | |
| s | The substring. |
| static const T* find | ( | const T * | str, | |
| T | c, | |||
| size_t | len = 0 | |||
| ) | throw () [static] |
Find the first occurrence of a character in a string.
| str | The string. | |
| c | The character. | |
| len | The number of characters in the string to scan, or 0 to scan the entire string (up to the NUL terminator). |
| static T* find | ( | T * | str, | |
| T | c, | |||
| size_t | len = 0 | |||
| ) | throw () [static] |
Find the first occurrence of a character in a string.
| str | The string. | |
| c | The character. | |
| len | The number of characters in the string to scan, or 0 to scan the entire string (up to the NUL terminator). |
Find the last occurrence of a substring in a string.
| str | The string. | |
| s | The substring. | |
| fromIndex | The index to begin searching backwards from. |
Find the last occurrence of a substring in a string.
| str | The string. | |
| s | The substring. | |
| fromIndex | The index to begin searching backwards from. |
Find the last occurrence of a character in a string.
| str | The string. | |
| c | The character. | |
| fromIndex | The index to begin searching backwards from. |
Find the last occurrence of a character in a string.
| str | The string. | |
| c | The character. | |
| fromIndex | The index to begin searching backwards from. |
| static T fromInt | ( | int | v | ) | throw () [static] |
Convert an integer value in the range 0 - 9 to the corresponding digit character '0' - '9'.
If the value is outside the acceptable range, the character '0' is returned.
| static const T* int64Format | ( | ) | throw () [static] |
Return the compiler-specific format string for 64-bit integers.
| static const T* intFormat | ( | ) | throw () [static] |
Return the format string for integers.
Returns the string "%d".
| static bool isAlpha | ( | T | c | ) | throw () [static] |
Test if a character is alphabetic.
| static bool isAlphaNumeric | ( | T | c | ) | throw () [static] |
Test if a character is alphanumeric.
| static bool isControl | ( | T | c | ) | throw () [static] |
Test if a character is a control character.
| static bool isDigit | ( | T | c | ) | throw () [static] |
Test if a character is a digit.
| static bool isGraphical | ( | T | c | ) | throw () [static] |
Test if a character is graphical.
| static bool isHexDigit | ( | T | c | ) | throw () [static] |
Test if a character is a hexadecimal digit.
| static bool isLowerCase | ( | T | c | ) | throw () [static] |
Test if a character is lowercase.
| static bool isNul | ( | T | c | ) | throw () [static] |
Test if a character is Nul.
| static bool isPrintable | ( | T | c | ) | throw () [static] |
Test if a character is printable.
| static bool isSign | ( | T | c | ) | throw () [static] |
Test if a character is a sign symbol ('+' or '-').
| static bool isUpperCase | ( | T | c | ) | throw () [static] |
Test if a character is uppercase.
| static bool isWhitespace | ( | T | c | ) | throw () [static] |
Test if a character is whitespace.
| static size_t length | ( | const T * | str | ) | throw () [static] |
Get the length of a string.
| str | The string. |
| static T minus | ( | ) | throw () [static] |
Return the '-' character.
| static T* move | ( | T * | dest, | |
| T * | src, | |||
| size_t | n | |||
| ) | throw () [static] |
Copy a string to a possibly overlapping destination string.
| dest | The destination string. | |
| src | The source string. | |
| n | The number of characters to copy. |
| static T nul | ( | ) | throw () [static] |
Return the NUL character.
| static const T* null | ( | ) | throw () [static] |
Return a null string.
| static const T* nullRep | ( | ) | throw () [static] |
Return a string representation of the null string.
Returns the string "(null)".
| static T plus | ( | ) | throw () [static] |
Return the '+' character.
| static int printf | ( | T * | str, | |
| size_t | len, | |||
| const T * | format, | |||
| ... | ||||
| ) | throw () [static] |
Write a formatted string.
| str | The string to write to. | |
| len | The maximum length of the string. | |
| format | The format string. |
| static int rawCompare | ( | const T * | str1, | |
| const T * | str2, | |||
| size_t | n | |||
| ) | throw () [static] |
Compare two strings.
This method differs from compare() in that it compares exactly the number of characters requested, without regard to nul terminators.
| str1 | The first string. | |
| str2 | The second string. | |
| n | The number of characters to compare. |
str1 < str2, a positive value if str1 > str2, and zero if the two strings are equal. | static T* rawCopy | ( | T * | dest, | |
| const T * | src, | |||
| size_t | n | |||
| ) | throw () [static] |
Copy a fixed number of characters.
This method differs from copy() in that it copies exactly the number of characters requested, without regard to nul terminators.
| dest | The destination string. | |
| src | The source string. | |
| n | The maximum number of characters to copy. |
| static size_t span | ( | const T * | str, | |
| const T * | accept | |||
| ) | throw () [static] |
Calculate the length of the initial segment of a string which consists entirely of characters in the given set.
| str | The string. | |
| accept | The set of characters. |
| static double toDouble | ( | const T * | str, | |
| T ** | endptr = NULL | |||
| ) | throw () [static] |
Parse a double-precision floating point value from the string.
| str | The string. | |
| endptr | A pointer at which to store a pointer to the first non-parsed character. |
| static float toFloat | ( | const T * | str, | |
| T ** | endptr = NULL | |||
| ) | throw () [static] |
Parse a floating-point value from the string.
| str | The string. | |
| endptr | A pointer at which to store a pointer to the first non-parsed character. |
| static int toInt | ( | T | c | ) | throw () [static] |
Convert a digit character in the range '0' - '9' to the corresponding integer value 0 - 9.
If the character is not a digit, 0 is returned.
| static int32_t toLong | ( | const T * | str, | |
| T ** | endptr = NULL, |
|||
| int | base = 10 | |||
| ) | throw () [static] |
Parse a long integer value from the string.
| str | The string. | |
| endptr | A pointer at which to store a pointer to the first non-parsed character. | |
| base | The numeric base. |
| static int64_t toLongLong | ( | const T * | str, | |
| T ** | endptr = NULL, |
|||
| int | base = 10 | |||
| ) | throw () [static] |
Parse a long long integer value from the string.
| str | The string. | |
| endptr | A pointer at which to store a pointer to the first non-parsed character. | |
| base | The numeric base. |
| static T toLowerCase | ( | T | c | ) | throw () [static] |
Get the lowercase equivalent of a character.
| static uint32_t toULong | ( | const T * | str, | |
| T ** | endptr = NULL, |
|||
| int | base = 10 | |||
| ) | throw () [static] |
Parse an unsigned long integer value from the string.
| str | The string. | |
| endptr | A pointer at which to store a pointer to the first non-parsed character. | |
| base | The numeric base. |
| static uint64_t toULongLong | ( | const T * | str, | |
| T ** | endptr = NULL, |
|||
| int | base = 10 | |||
| ) | throw () [static] |
Parse an unsigned long long integer value from the string.
| str | The string. | |
| endptr | A pointer at which to store a pointer to the first non-parsed character. | |
| base | The numeric base. |
| static T toUpperCase | ( | T | c | ) | throw () [static] |
Get the uppercase equivalent of a character.
| static const T* trueRep | ( | ) | throw () [static] |
Return a string representation of the boolean value true.
Returns the string "true".
| static const T* uint64Format | ( | ) | throw () [static] |
Return the compiler-specific format string for unsigned 64-bit integers.
| static const T* uintFormat | ( | ) | throw () [static] |
Return the format string for unsigned integers.
Returns the string "%u".
| static int vprintf | ( | T * | str, | |
| size_t | len, | |||
| const T * | format, | |||
| va_list | vp | |||
| ) | throw () [static] |
Write a formatted string.
| str | The string to write to. | |
| len | The maximum length of the string. | |
| format | The format string. | |
| vp | The varargs list. |
| static const T* whitespace | ( | ) | throw () [static] |
Return an array containing the set of whitespace characters.
1.5.9