The ITString class
Base class: none
The ITString class is a minimal C++ string class that meets the needs of the . An ITString object created without any parameters is, by default, null-valued. All null-valued ITString objects are equal.
This class provides the following methods.
| Method | Description |
|---|---|
| ITString() | Constructs a null string. |
| ITString(const char *str) | Constructs a string from null-terminated characters. This method assumes that the contents of the str buffer are in the client code set. |
| ITString(const char *str, ITBool in_server_codeset) | Constructs a string from null-terminated characters. The in_server_codeset parameter specifies whether the buffer is in the server code set. |
| operator const char *() const const char *Data() const | Returns a pointer to null-terminated characters
of the value of the string or NULL. Do not delete this
returned value. |
| int Length() const | Returns the number of multibyte characters in a string, excluding termination characters. |
| int Size() const | Returns the number of bytes in a string. |
| ITString &Trim(const char *pmc) |
Trims the single, rightmost occurrence of the
character (not string) starting at Trim() encapsulates searching for the rightmost character (which can be a multibyte byte character in a given locale) of the encapsulated string and truncation of that character. The search is performed by calling ITLocale::MRScan, which in turn encapsulates calling the GLS API function ifx_gl_mbsrchr(). |
| ITString &TrimWhite() | Removes trailing white space. |
| ITBool Equal(const ITString &) const
ITBool Equal(const char *) const |
Compares this string with another. White space is significant. |
| ITBool EqualNoCase(const ITString &) const
ITBool EqualNoCase(const char *) const |
Compares one string with another. Case is not significant. |
| ITBool LessThan(const ITString &) const | Compares this string with another. White space is significant. |
| long Hash() const | Returns a long integer value suitable for determining a hash bucket by using modulo operations. |
| ITString &Append(const ITString &) | Appends a copy of another string to this string. |
| ITString &Append(const char *) | Appends a copy of the character string to this string. |
| ITString GetToken(int &) const | Gets the token from the string beginning with the position specified by the integer argument. Token is a quoted string, number, sequence of non-blank alphanumeric characters, or any other character. Argument is set to the position after the token. |
| ITBool IsQuoted() const | Returns TRUE if the string is in single
or double quotation marks, FALSE otherwise. |
| ITBool Unquote() | If the string is quoted, removes the outer quotations
and returns TRUE, otherwise returns FALSE. |
| const char *Scan(const char *) const | Returns a pointer to the first occurrence in the string buffer of the specified multibyte character. |
| static const ITString Null | Represents null string. |
| inline ITBool IsNull() const | Returns TRUE if string is null. |
| int operator<opname>(const ITString &, const ITString &) | Compares the two strings. The operators you can use for opname are: ==, !=, <, <=, >, >=. |