Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Member Functions | Static Public Member Functions | List of all members
om::data::GenericString< CharType > Class Template Reference

A string class supporting unicode and ASCII character sets. More...

#include <omString.h>

Public Member Functions

 GenericString ()
 Create an empty string. More...
 
 GenericString (Char character)
 Create a string consisting of a single character. More...
 
 GenericString (const Char *array)
 Create a string from a NULL-terminated character array. More...
 
 GenericString (const UTF8Char *array)
 Create a string from a NULL-terminated character array. More...
 
 GenericString (const UTF16Char *array)
 Create a string from a NULL-terminated character array. More...
 
 GenericString (const UTF32Char *array)
 Create a string from a NULL-terminated character array. More...
 
 GenericString (const Char *array, Size length)
 Create a string from a character array with the specified length. More...
 
 GenericString (const UTF8Char *array, Size length)
 Create a string from a character array with the specified length. More...
 
 GenericString (const UTF16Char *array, Size length)
 Create a string from a character array with the specified length. More...
 
 GenericString (const UTF32Char *array, Size length)
 Create a string from a character array with the specified length. More...
 
 GenericString (const GenericString &other)
 Create a copy of the specified other string. More...
 
template<typename OtherCharType >
 GenericString (const GenericString< OtherCharType > &other)
 Create a copy of the specified other string with a different character type. More...
 
 GenericString (Bool boolean)
 Create a new boolean literal string for the specified value. More...
 
 GenericString (Short number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (UShort number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (Int number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (UInt number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (Long number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (ULong number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (LongLong number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (ULongLong number, Size base=10)
 Create a string which represents the specified integer number in the given base system. More...
 
 GenericString (Float number)
 Create a string which represents the specified floating-point number with default formating. More...
 
 GenericString (Float number, Size numDecimalPlaces, Size base=10, Bool allowScientific=true)
 Create a string which represents the specified floating-point number in the given base system. More...
 
 GenericString (Double number)
 Create a string which represents the specified double floating-point number with default formating. More...
 
 GenericString (Double number, Size numDecimalPlaces, Size base=10, Bool allowScientific=true)
 Create a string which represents the specified double floating-point number in the given base system. More...
 
 ~GenericString ()
 Destroy this string, releasing its internal character buffer if the reference count is 0. More...
 
GenericStringoperator= (const GenericString &other)
 Assign the contents of another string to this string. More...
 
Bool equals (const GenericString &other) const
 Return whether or not this string is exactly equal to another. More...
 
Bool equalsIgnoreCase (const GenericString &other) const
 Return whether or not this string is equal to another if letter case is ignored. More...
 
Bool equals (const CharType *characters) const
 Return whether or not this string is exactly equal to a NULL-terminated character string. More...
 
Bool equals (const CharType *characters, Size numCharacters) const
 Return whether or not this string is exactly equal to a character string of the given length. More...
 
Bool equalsIgnoreCase (const CharType *characters) const
 Return whether or not this string is equal to a NULL-terminated character string if letter case is ignored. More...
 
Bool equalsIgnoreCase (const CharType *characters, Size numCharacters) const
 Return whether or not this string is equal to a character string if letter case is ignored. More...
 
Bool operator== (const GenericString &other) const
 Return whether or not this string is exactly equal to another. More...
 
Bool operator!= (const GenericString &other) const
 Return whether or not this string is not equal to another. More...
 
Bool operator== (const CharType *other) const
 Return whether or not this string is exactly equal to a NULL-terminated character string. More...
 
Bool operator!= (const CharType *other) const
 Return whether or not this string is not equal to a NULL-terminated character string. More...
 
Int compareTo (const GenericString &other) const
 Return an integer indicating the lexical order of this string when compared to another. More...
 
Int compareToIgnoreCase (const GenericString &other) const
 Return an integer indicating the lexical order of this string when compared to another, ignoring letter case. More...
 
Int compareTo (const CharType *characters) const
 Return an integer indicating the lexical order of this string when compared to a C-string. More...
 
Int compareToIgnoreCase (const CharType *characters) const
 Return an integer indicating the lexical order of this string when compared to a C-string, ignoring letter case. More...
 
Bool operator< (const GenericString &other) const
 Return whether or not this string comes before another one in the lexical order. More...
 
Bool operator> (const GenericString &other) const
 Return whether or not this string comes after another one in the lexical order. More...
 
Bool operator<= (const GenericString &other) const
 Return whether or not this string comes before or is the same as another one in the lexical order. More...
 
Bool operator>= (const GenericString &other) const
 Return whether or not this string comes after or is the same as another one in the lexical order. More...
 
Bool operator< (const CharType *characters) const
 Return whether or not this string comes before a C-string in the lexical order. More...
 
Bool operator> (const CharType *characters) const
 Return whether or not this string comes after a C-string in the lexical order. More...
 
Bool operator<= (const CharType *characters) const
 Return whether or not this string comes before or is the same as a C-string in the lexical order. More...
 
Bool operator>= (const CharType *characters) const
 Return whether or not this string comes after or is the same as a C-string in the lexical order. More...
 
Bool operator<< (const GenericString &other) const
 Return whether or not this string comes before another one in the lexical order, ignoring letter case. More...
 
Bool operator>> (const GenericString &other) const
 Return whether or not this string comes after another one in the lexical order, ignoring letter case. More...
 
Bool operator<<= (const GenericString &other) const
 Return whether or not this string comes before or is the same as another one in the lexical order, ignoring letter case. More...
 
Bool operator>>= (const GenericString &other) const
 Return whether or not this string comes after or is the same as another one in the lexical order, ignoring letter case. More...
 
Bool operator<< (const CharType *characters) const
 Return whether or not this string comes before a C-string in the lexical order, ignoring letter case. More...
 
Bool operator>> (const CharType *characters) const
 Return whether or not this string comes before a C-string in the lexical order, ignoring letter case. More...
 
Bool operator<<= (const CharType *characters) const
 Return whether or not this string comes before or is the same as a C-string in the lexical order, ignoring letter case. More...
 
Bool operator>>= (const CharType *characters) const
 Return whether or not this string comes after or is the same as a C-string in the lexical order, ignoring letter case. More...
 
Bool contains (const GenericString &other) const
 Return whether or not this string contains another string as a substring. More...
 
Bool containsIgnoreCase (const GenericString &other) const
 Return whether or not this string contains another string as a substring if letter case is ignored. More...
 
Bool contains (const CharType *characters) const
 Return whether or not this string contains another NULL-terminated string as a substring. More...
 
Bool containsIgnoreCase (const CharType *characters) const
 Return whether or not this string contains another NULL-terminated string as a substring if letter case is ignored. More...
 
Bool contains (const CharType *characters, Size numCharacters) const
 Return whether or not this string contains another string as a substring. More...
 
Bool containsIgnoreCase (const CharType *characters, Size numCharacters) const
 Return whether or not this string contains another string as a substring if letter case is ignored. More...
 
GenericString operator+ (const GenericString &other) const
 
GenericString operator+ (const Char *characters) const
 
GenericString operator+ (Char character) const
 
GenericString operator+ (Short value) const
 
GenericString operator+ (UShort value) const
 
GenericString operator+ (Int value) const
 
GenericString operator+ (UInt value) const
 
GenericString operator+ (Long value) const
 
GenericString operator+ (ULong value) const
 
GenericString operator+ (LongLong value) const
 
GenericString operator+ (ULongLong value) const
 
 operator Int () const
 Cast this string to an integer, returning math::nan<Int32>() if the conversion fails. More...
 
 operator UInt () const
 Cast this string to an integer, returning math::nan<UInt32>() if the conversion fails. More...
 
 operator Long () const
 Cast this string to an integer, returning math::nan<Int32>() if the conversion fails. More...
 
 operator ULong () const
 Cast this string to an integer, returning math::nan<UInt32>() if the conversion fails. More...
 
 operator LongLong () const
 Cast this string to an integer, returning math::nan<Int64>() if the conversion fails. More...
 
 operator ULongLong () const
 Cast this string to an integer, returning math::nan<UInt64>() if the conversion fails. More...
 
 operator Float () const
 Cast this string to a floating-point number, returning math::nan<Float>() if the conversion fails. More...
 
 operator Double () const
 Cast this string to a double floating-point number, returning math::nan<Double>() if the conversion fails. More...
 
Bool toBool (Bool &value) const
 Convert this string to a boolean value, returning whether or not the conversion was successful. More...
 
Bool toFloat (Float &value) const
 Convert this string to a float value, returning whether or not the conversion was successful. More...
 
Bool toDouble (Double &value) const
 Convert this string to a double value, returning whether or not the conversion was successful. More...
 
Bool toInt (Int &value) const
 Convert this string to an integer value, returning whether or not the conversion was successful. More...
 
Bool toUInt (UInt32 &value) const
 Convert this string to an unsigned integer value, returning TRUE if the conversion was successful. More...
 
Bool toInt32 (Int32 &value) const
 Convert this string to a 32-bit integer value, returning whether or not the conversion was successful. More...
 
Bool toUInt32 (UInt32 &value) const
 Convert this string to a 32-bit unsigned integer value, returning TRUE if the conversion was successful. More...
 
Bool toInt64 (Int64 &value) const
 Convert this string to a 64-bit integer value, returning whether or not the conversion was successful. More...
 
Bool toUInt64 (UInt64 &value) const
 Convert this string to a 64-bit unsigned integer value, returning TRUE if the conversion was successful. More...
 
template<typename T >
Bool toNumber (T &value) const
 Convert this string to a templated number value, returning TRUE if the conversion was successful. More...
 
Bool isANumber () const
 Return whether or not this string represents a valid number. More...
 
CharType get (Index index) const
 Return the character at the specified index in this string. More...
 
CharType operator[] (Index index) const
 Return the character at the specified index in this string. More...
 
CharType operator() (Index index) const
 Return the character at the specified index in this string. More...
 
GenericString getSubString (Index start, Size number) const
 Return a sub-string of this string, specified by the start index and number of code points (characters). More...
 
const CharType * getCString () const
 Return a pointer to a NULL-terminated character array representing this string. More...
 
const CharType * getPointer () const
 Return a pointer to a NULL-terminated character array representing this string. More...
 
 operator const CharType * () const
 Return a pointer to a NULL-terminated character array representing this string. More...
 
Size getLength () const
 Return the number of character code points that are part of this string, not including the NULL terminator. More...
 
Size getLengthInCharacters () const
 Return the actual length of this string in characters. More...
 
Hash getHashCode () const
 Return a hash code for this string. More...
 
GenericString toLowerCase () const
 Convert this string to lower case. More...
 
GenericString toUpperCase () const
 Convert this string to lower case. More...
 

Static Public Member Functions

static Int compare (const CharType *string1, const CharType *string2)
 Return an integer indicating the lexical order of a C-string when compared to a C-string. More...
 
static Int compareIgnoreCase (const CharType *string1, const CharType *string2)
 Return an integer indicating the lexical order of a C-string when compared to a C-string, ignoring letter case. More...
 
static Bool contains (const CharType *string1, const CharType *string2)
 Return whether or not a NULL-terminated string contains another NULL-terminated string as a substring. More...
 
static Bool contains (const CharType *string1, const CharType *string2, Size length)
 Return whether or not a NULL-terminated string contains another string as a substring. More...
 
static Bool containsIgnoreCase (const CharType *string1, const CharType *string2)
 Return whether or not a NULL-terminated string contains another NULL-terminated string as a substring if letter case is ignored. More...
 
static Bool containsIgnoreCase (const CharType *string1, const CharType *string2, Size length)
 Return whether or not a NULL-terminated string contains another string as a substring if letter case is ignored. More...
 
static Bool equals (const CharType *string1, const CharType *string2)
 
static Bool equals (const CharType *string1, const CharType *string2, Size length)
 
static Bool equalsIgnoreCase (const CharType *string1, const CharType *string2)
 
static Bool equalsIgnoreCase (const CharType *string1, const CharType *string2, Size length)
 
static Bool convertToBool (const CharType *stringStart, const CharType *stringEnd, Bool &result)
 Convert a string specified by starting and ending pointers to a boolean value. More...
 
static Bool convertToInt (const CharType *stringStart, const CharType *stringEnd, Int &result)
 Convert a string specified by starting and ending pointers to an integer value. More...
 
static Bool convertToInt32 (const CharType *stringStart, const CharType *stringEnd, Int32 &result)
 Convert a string specified by starting and ending pointers to an integer value. More...
 
static Bool convertToUInt32 (const CharType *stringStart, const CharType *stringEnd, UInt32 &result)
 Convert a string specified by starting and ending pointers to an integer value. More...
 
static Bool convertToInt64 (const CharType *stringStart, const CharType *stringEnd, Int64 &result)
 Convert a string specified by starting and ending pointers to an integer value. More...
 
static Bool convertToUInt64 (const CharType *stringStart, const CharType *stringEnd, UInt64 &result)
 Convert a string specified by starting and ending pointers to an integer value. More...
 
static Bool convertToFloat (const CharType *stringStart, const CharType *stringEnd, Float &result)
 Convert a string specified by starting and ending pointers to a float value. More...
 
static Bool convertToDouble (const CharType *stringStart, const CharType *stringEnd, Double &result)
 Convert a string specified by starting and ending pointers to a float value. More...
 
template<typename T >
static Bool convertToNumber (const CharType *stringStart, const CharType *stringEnd, T &result)
 Convert a string specified by starting and ending pointers to a number value. More...
 
static Size getLength (const CharType *characters)
 Return the number of code points that are part of the specified NULL-terminated string. More...
 
static Size getLengthInCharacters (const CharType *characters)
 Return the number of characters that are part of the specified NULL-terminated string. More...
 
static CharType toLowerCase (CharType character)
 
static CharType toUpperCase (CharType character)
 
static Bool isLetter (CharType character)
 Return whether or not the specified character is a letter character. More...
 
static Bool isUpperCase (CharType character)
 Return whether or not the specified character is an upper-case character. More...
 
static Bool isLowerCase (CharType character)
 Return whether or not the specified character is a lower-case character. More...
 
static Bool isDigit (CharType character)
 Return whether or not the specified character is a decimal digit (0 to 9). More...
 
static Bool isOctalDigit (CharType character)
 Return whether or not the specified character is an octal digit (0 to 7). More...
 
static Bool isBinaryDigit (CharType character)
 Return whether or not the specified character is an binary digit (0 or 1). More...
 
static Bool isHexDigit (CharType character)
 Return whether or not the specified character is a hexidecimal digit (0 to 9, A to F). More...
 
static Bool isWhitespace (CharType character)
 Return whether or not the specified character is a whitespace character (i.e. space, tab, new line, etc). More...
 
static Bool isPunctuation (CharType c)
 Return whether or not the specified character is a puntuation character (i.e. period, comma, semicolon, etc). More...
 

Detailed Description

template<typename CharType>
class om::data::GenericString< CharType >

A string class supporting unicode and ASCII character sets.

The GenericString class is a template class that allows the user to use any of four different specializations: Char for ASCII strings, UTF8Char for UTF-8 strings, UTF16Char for UTF-16 strings, and UTF32Char for UTF-32 strings. In addition to this functionality, it provides comprehensive number-to-string and string-to-number conversion using constructors and cast operators. All strings are immutable after creation. Use the GenericStringBuffer class to efficiently compose strings.

Strings are reference-counted, so the overhead of copying a string object is very small.

Constructor & Destructor Documentation

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( )
inline

Create an empty string.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Char  character)
inline

Create a string consisting of a single character.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const Char array)

Create a string from a NULL-terminated character array.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const UTF8Char array)

Create a string from a NULL-terminated character array.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const UTF16Char array)

Create a string from a NULL-terminated character array.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const UTF32Char array)

Create a string from a NULL-terminated character array.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const Char array,
Size  length 
)

Create a string from a character array with the specified length.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const UTF8Char array,
Size  length 
)

Create a string from a character array with the specified length.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const UTF16Char array,
Size  length 
)

Create a string from a character array with the specified length.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const UTF32Char array,
Size  length 
)

Create a string from a character array with the specified length.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( const GenericString< CharType > &  other)
inline

Create a copy of the specified other string.

template<typename CharType >
template<typename OtherCharType >
om::data::GenericString< CharType >::GenericString ( const GenericString< OtherCharType > &  other)
explicit

Create a copy of the specified other string with a different character type.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Bool  boolean)
inlineexplicit

Create a new boolean literal string for the specified value.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Short  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( UShort  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Int  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( UInt  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Long  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( ULong  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( LongLong  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( ULongLong  number,
Size  base = 10 
)
inlineexplicit

Create a string which represents the specified integer number in the given base system.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Float  number)
inlineexplicit

Create a string which represents the specified floating-point number with default formating.

The number is displayed with the maximum precision for its type in base 10, and scientific notation is automatically used when necessary.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Float  number,
Size  numDecimalPlaces,
Size  base = 10,
Bool  allowScientific = true 
)
inlineexplicit

Create a string which represents the specified floating-point number in the given base system.

This method allows the user to determine the number of decimal places to display, the base system, and whether or not the allow scientific notation.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Double  number)
inlineexplicit

Create a string which represents the specified double floating-point number with default formating.

The number is displayed with the maximum precision for its type in base 10, and scientific notation is automatically used when necessary.

template<typename CharType >
om::data::GenericString< CharType >::GenericString ( Double  number,
Size  numDecimalPlaces,
Size  base = 10,
Bool  allowScientific = true 
)
inlineexplicit

Create a string which represents the specified double floating-point number in the given base system.

This method allows the user to determine the number of decimal places to display, the base system, and whether or not the allow scientific notation.

template<typename CharType >
om::data::GenericString< CharType >::~GenericString ( )
inline

Destroy this string, releasing its internal character buffer if the reference count is 0.

Member Function Documentation

template<typename CharType >
GenericString& om::data::GenericString< CharType >::operator= ( const GenericString< CharType > &  other)
inline

Assign the contents of another string to this string.

The reference count of the other string is increased by one and it replaces the current string of this object, deallocating the previous string if its reference count reaches 0.

template<typename CharType >
Bool om::data::GenericString< CharType >::equals ( const GenericString< CharType > &  other) const
inline

Return whether or not this string is exactly equal to another.

template<typename CharType >
Bool om::data::GenericString< CharType >::equalsIgnoreCase ( const GenericString< CharType > &  other) const
inline

Return whether or not this string is equal to another if letter case is ignored.

template<typename CharType >
Bool om::data::GenericString< CharType >::equals ( const CharType *  characters) const
inline

Return whether or not this string is exactly equal to a NULL-terminated character string.

template<typename CharType >
Bool om::data::GenericString< CharType >::equals ( const CharType *  characters,
Size  numCharacters 
) const
inline

Return whether or not this string is exactly equal to a character string of the given length.

template<typename CharType >
Bool om::data::GenericString< CharType >::equalsIgnoreCase ( const CharType *  characters) const
inline

Return whether or not this string is equal to a NULL-terminated character string if letter case is ignored.

template<typename CharType >
Bool om::data::GenericString< CharType >::equalsIgnoreCase ( const CharType *  characters,
Size  numCharacters 
) const
inline

Return whether or not this string is equal to a character string if letter case is ignored.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator== ( const GenericString< CharType > &  other) const
inline

Return whether or not this string is exactly equal to another.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator!= ( const GenericString< CharType > &  other) const
inline

Return whether or not this string is not equal to another.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator== ( const CharType *  other) const
inline

Return whether or not this string is exactly equal to a NULL-terminated character string.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator!= ( const CharType *  other) const
inline

Return whether or not this string is not equal to a NULL-terminated character string.

template<typename CharType >
Int om::data::GenericString< CharType >::compareTo ( const GenericString< CharType > &  other) const
inline

Return an integer indicating the lexical order of this string when compared to another.

If this string should come before the other, -1 is returned. If this string is equal to the other, 0 is returned. If this string should come after the other, 1 is returned.

template<typename CharType >
Int om::data::GenericString< CharType >::compareToIgnoreCase ( const GenericString< CharType > &  other) const
inline

Return an integer indicating the lexical order of this string when compared to another, ignoring letter case.

If this string should come before the other, -1 is returned. If this string is equal to the other, 0 is returned. If this string should come after the other, 1 is returned.

template<typename CharType >
Int om::data::GenericString< CharType >::compareTo ( const CharType *  characters) const
inline

Return an integer indicating the lexical order of this string when compared to a C-string.

If this string should come before the other, -1 is returned. If this string is equal to the other, 0 is returned. If this string should come after the other, 1 is returned.

template<typename CharType >
Int om::data::GenericString< CharType >::compareToIgnoreCase ( const CharType *  characters) const
inline

Return an integer indicating the lexical order of this string when compared to a C-string, ignoring letter case.

If this string should come before the other, -1 is returned. If this string is equal to the other, 0 is returned. If this string should come after the other, 1 is returned.

template<typename CharType >
static Int om::data::GenericString< CharType >::compare ( const CharType *  string1,
const CharType *  string2 
)
static

Return an integer indicating the lexical order of a C-string when compared to a C-string.

template<typename CharType >
static Int om::data::GenericString< CharType >::compareIgnoreCase ( const CharType *  string1,
const CharType *  string2 
)
static

Return an integer indicating the lexical order of a C-string when compared to a C-string, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator< ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes before another one in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator> ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes after another one in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator<= ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes before or is the same as another one in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator>= ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes after or is the same as another one in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator< ( const CharType *  characters) const
inline

Return whether or not this string comes before a C-string in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator> ( const CharType *  characters) const
inline

Return whether or not this string comes after a C-string in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator<= ( const CharType *  characters) const
inline

Return whether or not this string comes before or is the same as a C-string in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator>= ( const CharType *  characters) const
inline

Return whether or not this string comes after or is the same as a C-string in the lexical order.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator<< ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes before another one in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator>> ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes after another one in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator<<= ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes before or is the same as another one in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator>>= ( const GenericString< CharType > &  other) const
inline

Return whether or not this string comes after or is the same as another one in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator<< ( const CharType *  characters) const
inline

Return whether or not this string comes before a C-string in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator>> ( const CharType *  characters) const
inline

Return whether or not this string comes before a C-string in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator<<= ( const CharType *  characters) const
inline

Return whether or not this string comes before or is the same as a C-string in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::operator>>= ( const CharType *  characters) const
inline

Return whether or not this string comes after or is the same as a C-string in the lexical order, ignoring letter case.

template<typename CharType >
Bool om::data::GenericString< CharType >::contains ( const GenericString< CharType > &  other) const
inline

Return whether or not this string contains another string as a substring.

template<typename CharType >
Bool om::data::GenericString< CharType >::containsIgnoreCase ( const GenericString< CharType > &  other) const
inline

Return whether or not this string contains another string as a substring if letter case is ignored.

template<typename CharType >
Bool om::data::GenericString< CharType >::contains ( const CharType *  characters) const
inline

Return whether or not this string contains another NULL-terminated string as a substring.

template<typename CharType >
Bool om::data::GenericString< CharType >::containsIgnoreCase ( const CharType *  characters) const
inline

Return whether or not this string contains another NULL-terminated string as a substring if letter case is ignored.

template<typename CharType >
Bool om::data::GenericString< CharType >::contains ( const CharType *  characters,
Size  numCharacters 
) const
inline

Return whether or not this string contains another string as a substring.

template<typename CharType >
Bool om::data::GenericString< CharType >::containsIgnoreCase ( const CharType *  characters,
Size  numCharacters 
) const
inline

Return whether or not this string contains another string as a substring if letter case is ignored.

template<typename CharType >
static Bool om::data::GenericString< CharType >::contains ( const CharType *  string1,
const CharType *  string2 
)
static

Return whether or not a NULL-terminated string contains another NULL-terminated string as a substring.

template<typename CharType >
static Bool om::data::GenericString< CharType >::contains ( const CharType *  string1,
const CharType *  string2,
Size  length 
)
static

Return whether or not a NULL-terminated string contains another string as a substring.

template<typename CharType >
static Bool om::data::GenericString< CharType >::containsIgnoreCase ( const CharType *  string1,
const CharType *  string2 
)
static

Return whether or not a NULL-terminated string contains another NULL-terminated string as a substring if letter case is ignored.

template<typename CharType >
static Bool om::data::GenericString< CharType >::containsIgnoreCase ( const CharType *  string1,
const CharType *  string2,
Size  length 
)
static

Return whether or not a NULL-terminated string contains another string as a substring if letter case is ignored.

template<typename CharType >
static Bool om::data::GenericString< CharType >::equals ( const CharType *  string1,
const CharType *  string2 
)
static
template<typename CharType >
static Bool om::data::GenericString< CharType >::equals ( const CharType *  string1,
const CharType *  string2,
Size  length 
)
static
template<typename CharType >
static Bool om::data::GenericString< CharType >::equalsIgnoreCase ( const CharType *  string1,
const CharType *  string2 
)
static
template<typename CharType >
static Bool om::data::GenericString< CharType >::equalsIgnoreCase ( const CharType *  string1,
const CharType *  string2,
Size  length 
)
static
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( const GenericString< CharType > &  other) const
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( const Char characters) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( Char  character) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( Short  value) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( UShort  value) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( Int  value) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( UInt  value) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( Long  value) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( ULong  value) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( LongLong  value) const
inline
template<typename CharType >
GenericString om::data::GenericString< CharType >::operator+ ( ULongLong  value) const
inline
template<typename CharType >
om::data::GenericString< CharType >::operator Int ( ) const
inline

Cast this string to an integer, returning math::nan<Int32>() if the conversion fails.

template<typename CharType >
om::data::GenericString< CharType >::operator UInt ( ) const
inline

Cast this string to an integer, returning math::nan<UInt32>() if the conversion fails.

template<typename CharType >
om::data::GenericString< CharType >::operator Long ( ) const
inline

Cast this string to an integer, returning math::nan<Int32>() if the conversion fails.

template<typename CharType >
om::data::GenericString< CharType >::operator ULong ( ) const
inline

Cast this string to an integer, returning math::nan<UInt32>() if the conversion fails.

template<typename CharType >
om::data::GenericString< CharType >::operator LongLong ( ) const
inline

Cast this string to an integer, returning math::nan<Int64>() if the conversion fails.

template<typename CharType >
om::data::GenericString< CharType >::operator ULongLong ( ) const
inline

Cast this string to an integer, returning math::nan<UInt64>() if the conversion fails.

template<typename CharType >
om::data::GenericString< CharType >::operator Float ( ) const
inline

Cast this string to a floating-point number, returning math::nan<Float>() if the conversion fails.

template<typename CharType >
om::data::GenericString< CharType >::operator Double ( ) const
inline

Cast this string to a double floating-point number, returning math::nan<Double>() if the conversion fails.

template<typename CharType >
Bool om::data::GenericString< CharType >::toBool ( Bool value) const

Convert this string to a boolean value, returning whether or not the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toFloat ( Float value) const

Convert this string to a float value, returning whether or not the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toDouble ( Double value) const

Convert this string to a double value, returning whether or not the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toInt ( Int value) const
inline

Convert this string to an integer value, returning whether or not the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toUInt ( UInt32 value) const
inline

Convert this string to an unsigned integer value, returning TRUE if the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toInt32 ( Int32 value) const
inline

Convert this string to a 32-bit integer value, returning whether or not the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toUInt32 ( UInt32 value) const
inline

Convert this string to a 32-bit unsigned integer value, returning TRUE if the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toInt64 ( Int64 value) const
inline

Convert this string to a 64-bit integer value, returning whether or not the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
Bool om::data::GenericString< CharType >::toUInt64 ( UInt64 value) const
inline

Convert this string to a 64-bit unsigned integer value, returning TRUE if the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter.

template<typename CharType >
template<typename T >
Bool om::data::GenericString< CharType >::toNumber ( T &  value) const
inline

Convert this string to a templated number value, returning TRUE if the conversion was successful.

If the conversion is successful, the converted value is placed in the output parameter. This method will not compile for non-primitive types.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToBool ( const CharType *  stringStart,
const CharType *  stringEnd,
Bool result 
)
inlinestatic

Convert a string specified by starting and ending pointers to a boolean value.

The method returns whether or not the conversion was successful.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToInt ( const CharType *  stringStart,
const CharType *  stringEnd,
Int result 
)
inlinestatic

Convert a string specified by starting and ending pointers to an integer value.

The method returns whether or not the conversion was successful.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToInt32 ( const CharType *  stringStart,
const CharType *  stringEnd,
Int32 result 
)
inlinestatic

Convert a string specified by starting and ending pointers to an integer value.

The method returns whether or not the conversion was successful.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToUInt32 ( const CharType *  stringStart,
const CharType *  stringEnd,
UInt32 result 
)
inlinestatic

Convert a string specified by starting and ending pointers to an integer value.

The method returns whether or not the conversion was successful.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToInt64 ( const CharType *  stringStart,
const CharType *  stringEnd,
Int64 result 
)
inlinestatic

Convert a string specified by starting and ending pointers to an integer value.

The method returns whether or not the conversion was successful.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToUInt64 ( const CharType *  stringStart,
const CharType *  stringEnd,
UInt64 result 
)
inlinestatic

Convert a string specified by starting and ending pointers to an integer value.

The method returns whether or not the conversion was successful.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToFloat ( const CharType *  stringStart,
const CharType *  stringEnd,
Float result 
)
inlinestatic

Convert a string specified by starting and ending pointers to a float value.

The method returns whether or not the conversion was successful.

template<typename CharType >
static Bool om::data::GenericString< CharType >::convertToDouble ( const CharType *  stringStart,
const CharType *  stringEnd,
Double result 
)
inlinestatic

Convert a string specified by starting and ending pointers to a float value.

The method returns whether or not the conversion was successful.

template<typename CharType >
template<typename T >
static Bool om::data::GenericString< CharType >::convertToNumber ( const CharType *  stringStart,
const CharType *  stringEnd,
T &  result 
)
inlinestatic

Convert a string specified by starting and ending pointers to a number value.

The method returns whether or not the conversion was successful.

template<typename CharType >
Bool om::data::GenericString< CharType >::isANumber ( ) const
inline

Return whether or not this string represents a valid number.

template<typename CharType >
CharType om::data::GenericString< CharType >::get ( Index  index) const
inline

Return the character at the specified index in this string.

A debug assertion is raised if the index is invalid.

template<typename CharType >
CharType om::data::GenericString< CharType >::operator[] ( Index  index) const
inline

Return the character at the specified index in this string.

A debug assertion is raised if the index is invalid.

template<typename CharType >
CharType om::data::GenericString< CharType >::operator() ( Index  index) const
inline

Return the character at the specified index in this string.

A debug assertion is raised if the index is invalid.

template<typename CharType >
GenericString om::data::GenericString< CharType >::getSubString ( Index  start,
Size  number 
) const
inline

Return a sub-string of this string, specified by the start index and number of code points (characters).

template<typename CharType >
const CharType* om::data::GenericString< CharType >::getCString ( ) const
inline

Return a pointer to a NULL-terminated character array representing this string.

template<typename CharType >
const CharType* om::data::GenericString< CharType >::getPointer ( ) const
inline

Return a pointer to a NULL-terminated character array representing this string.

template<typename CharType >
om::data::GenericString< CharType >::operator const CharType * ( ) const
inline

Return a pointer to a NULL-terminated character array representing this string.

template<typename CharType >
Size om::data::GenericString< CharType >::getLength ( ) const
inline

Return the number of character code points that are part of this string, not including the NULL terminator.

template<typename CharType >
Size om::data::GenericString< CharType >::getLengthInCharacters ( ) const

Return the actual length of this string in characters.

This method parses the multi-byte encoded string and determines the actual number of characters that it contains (which will be less than or equal to the number of code points).

template<typename CharType >
static Size om::data::GenericString< CharType >::getLength ( const CharType *  characters)
static

Return the number of code points that are part of the specified NULL-terminated string.

The value returned does not include the NULL termination character.

template<typename CharType >
static Size om::data::GenericString< CharType >::getLengthInCharacters ( const CharType *  characters)
static

Return the number of characters that are part of the specified NULL-terminated string.

This method parses the multi-byte encoded string and determines the actual number of characters that it contains (which will be less than or equal to the number of code points).

template<typename CharType >
Hash om::data::GenericString< CharType >::getHashCode ( ) const
inline

Return a hash code for this string.

template<typename CharType >
GenericString om::data::GenericString< CharType >::toLowerCase ( ) const

Convert this string to lower case.

template<typename CharType >
GenericString om::data::GenericString< CharType >::toUpperCase ( ) const

Convert this string to lower case.

template<typename CharType >
static CharType om::data::GenericString< CharType >::toLowerCase ( CharType  character)
inlinestatic
template<typename CharType >
static CharType om::data::GenericString< CharType >::toUpperCase ( CharType  character)
inlinestatic
template<typename CharType >
static Bool om::data::GenericString< CharType >::isLetter ( CharType  character)
inlinestatic

Return whether or not the specified character is a letter character.

template<typename CharType >
static Bool om::data::GenericString< CharType >::isUpperCase ( CharType  character)
inlinestatic

Return whether or not the specified character is an upper-case character.

template<typename CharType >
static Bool om::data::GenericString< CharType >::isLowerCase ( CharType  character)
inlinestatic

Return whether or not the specified character is a lower-case character.

template<typename CharType >
static Bool om::data::GenericString< CharType >::isDigit ( CharType  character)
inlinestatic

Return whether or not the specified character is a decimal digit (0 to 9).

template<typename CharType >
static Bool om::data::GenericString< CharType >::isOctalDigit ( CharType  character)
inlinestatic

Return whether or not the specified character is an octal digit (0 to 7).

template<typename CharType >
static Bool om::data::GenericString< CharType >::isBinaryDigit ( CharType  character)
inlinestatic

Return whether or not the specified character is an binary digit (0 or 1).

template<typename CharType >
static Bool om::data::GenericString< CharType >::isHexDigit ( CharType  character)
inlinestatic

Return whether or not the specified character is a hexidecimal digit (0 to 9, A to F).

template<typename CharType >
static Bool om::data::GenericString< CharType >::isWhitespace ( CharType  character)
inlinestatic

Return whether or not the specified character is a whitespace character (i.e. space, tab, new line, etc).

template<typename CharType >
static Bool om::data::GenericString< CharType >::isPunctuation ( CharType  c)
inlinestatic

Return whether or not the specified character is a puntuation character (i.e. period, comma, semicolon, etc).


The documentation for this class was generated from the following file: