version 1.80, 2003/11/15 02:49:54
|
version 1.81, 2004/04/08 14:50:55
|
|
|
const char STRING_FLAG_ASCII[] = "ASCII"; | const char STRING_FLAG_ASCII[] = "ASCII"; |
const char STRING_FLAG_UTF8[] = "UTF8"; | const char STRING_FLAG_UTF8[] = "UTF8"; |
| |
|
// Locale constants |
|
// These constants need to be defined as follows: |
|
// lower case language; underscore; Uppercase Country |
|
const char ENGLISH_US[] = "en_US"; |
|
|
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class String; | class String; |
|
|
| |
/** Initialize from a plain C-String: | /** Initialize from a plain C-String: |
@param str Specifies the name of the String instance. | @param str Specifies the name of the String instance. |
|
API supports UTF8 |
*/ | */ |
String(const char* str); | String(const char* str); |
| |
|
|
/** Initialize from the first n characters of a plain C-String: | /** Initialize from the first n characters of a plain C-String: |
@param str Specifies the name of the String instance. | @param str Specifies the name of the String instance. |
@param u Specifies the Uint32 size. | @param u Specifies the Uint32 size. |
|
API supports UTF8 |
*/ | */ |
String(const char* str, Uint32 n); | String(const char* str, Uint32 n); |
| |
|
|
/** Assign this string with String str. | /** Assign this string with String str. |
@param str String to assign. | @param str String to assign. |
@return Returns the String. | @return Returns the String. |
|
API supports UTF8 |
*/ | */ |
String& assign(const String& str); | String& assign(const String& str); |
| |
|
|
| |
/** Assign this string with the plain C-String str. | /** Assign this string with the plain C-String str. |
@param str REVIEWERS: Insert text here. | @param str REVIEWERS: Insert text here. |
|
API supports UTF8 |
*/ | */ |
String& assign(const char* str); | String& assign(const char* str); |
| |
/** Assign this string with first n characters of the plain C-String str. | /** Assign this string with first n characters of the plain C-String str. |
@param str REVIEWERS: Insert text here. | @param str REVIEWERS: Insert text here. |
@param n REVIEWERS: Insert text here. | @param n REVIEWERS: Insert text here. |
|
API supports UTF8 |
*/ | */ |
String& assign(const char* str, Uint32 n); | String& assign(const char* str, Uint32 n); |
| |
|
|
| |
/** Create an 8-bit representation of this String object. For example, | /** Create an 8-bit representation of this String object. For example, |
| |
@return CString object that provides access to the 8-bit String |
@return CString object that provides access to the UTF8 String |
representation. | representation. |
| |
<pre> | <pre> |
|
|
*/ | */ |
Uint32 reverseFind(Char16 c) const; | Uint32 reverseFind(Char16 c) const; |
| |
/** Converts all characters in this string to lowercase characters. |
/** Converts all characters in this string to lowercase characters, |
|
ICU : Operation will use default locale or the locale provided |
|
NON ICU: Operattion will use c runtime function |
*/ | */ |
void toLower(); | void toLower(); |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
/** @param strLocale const char * is the locale to use for the operation. |
|
If NULL will use the default locale for the process. |
|
Refer to Locale constants for formating. |
|
*/ |
|
void toLower(const char * strLocale); |
|
#endif |
|
|
|
/** Converts all characters in this string to lowercase characters. |
|
@param strLocale const char * is the locale to use for the operation. |
|
If NULL will use the default locale for the process. |
|
ICU : Operation will use default locale or the locale provided |
|
NON ICU: Operattion will use c runtime function |
|
Refer to Locale constants for formating. |
|
*/ |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
void toUpper(const char * strLocale = NULL); |
|
#endif |
| |
/** Compare the first n characters of the two strings. | /** Compare the first n characters of the two strings. |
@param s1 First null-terminated string for the comparison. | @param s1 First null-terminated string for the comparison. |
|
|
| |
NOTE: Use the comparison operators <,<= > >= to compare | NOTE: Use the comparison operators <,<= > >= to compare |
String objects. | String objects. |
|
ICU : Operation will use default locale or the locale provided |
|
NON ICU: Operattion will use c runtime function |
*/ | */ |
static int compareNoCase(const String& s1, const String& s2); | static int compareNoCase(const String& s1, const String& s2); |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
/** @param strLocale const char * is the locale to use for the operation. |
|
If NULL will use the default locale for the process. |
|
Refer to Locale constants for formating. |
|
*/ |
|
static int compareNoCase(const String& s1, const String& s2, const char * strLocale); |
|
#endif |
| |
/** Compare two String objects for equality. | /** Compare two String objects for equality. |
@param s1 First <TT>String</TT> for comparison. | @param s1 First <TT>String</TT> for comparison. |
|
|
@param str2 Second String parameter. | @param str2 Second String parameter. |
@return true If strings are equal independent of case, flase | @return true If strings are equal independent of case, flase |
otherwise. | otherwise. |
|
|
|
ICU : Operation will use default locale or the locale provided |
|
NON ICU: Operation will use c runtime function |
*/ | */ |
static Boolean equalNoCase(const String& str1, const String& str2); | static Boolean equalNoCase(const String& str1, const String& str2); |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
/** @param strLocale const char * is the locale to use for the operation. |
|
If NULL will use the default locale for the process. |
|
Refer to Locale constants for formating. |
|
*/ |
|
static Boolean equalNoCase(const String& str1, const String& str2, const char * strLocale); |
|
#endif |
| |
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES | #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
// UTF8 specific code: | // UTF8 specific code: |
|
|
*/ | */ |
CString getCStringUTF8() const; | CString getCStringUTF8() const; |
| |
/** Tests whether a C string contains valid UTF-8 characters. |
|
@param str The C string |
|
*/ |
|
static Boolean isUTF8(const char*); |
|
#endif | #endif |
| |
private: | private: |