webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
#include <unistr.h>
Public Types | |
enum | EInvariant { kInvariant, kInvariant, kInvariant } |
enum | EInvariant { kInvariant, kInvariant, kInvariant } |
enum | EInvariant { kInvariant, kInvariant, kInvariant } |
Static Public Member Functions | |
static UnicodeString | fromUTF8 (const StringPiece &utf8) |
static UnicodeString | fromUTF32 (const UChar32 *utf32, int32_t length) |
static UClassID U_EXPORT2 | getStaticClassID () |
static UnicodeString | fromUTF8 (const StringPiece &utf8) |
static UnicodeString | fromUTF32 (const UChar32 *utf32, int32_t length) |
static UClassID U_EXPORT2 | getStaticClassID () |
static UnicodeString | fromUTF8 (const StringPiece &utf8) |
static UnicodeString | fromUTF32 (const UChar32 *utf32, int32_t length) |
static UClassID U_EXPORT2 | getStaticClassID () |
Protected Member Functions | |
virtual int32_t | getLength () const |
virtual UChar | getCharAt (int32_t offset) const |
virtual UChar32 | getChar32At (int32_t offset) const |
virtual int32_t | getLength () const |
virtual UChar | getCharAt (int32_t offset) const |
virtual UChar32 | getChar32At (int32_t offset) const |
virtual int32_t | getLength () const |
virtual UChar | getCharAt (int32_t offset) const |
virtual UChar32 | getChar32At (int32_t offset) const |
Protected Member Functions inherited from Replaceable | |
Replaceable () | |
Replaceable () | |
Replaceable () | |
Friends | |
class | StringThreadTest |
class | UnicodeStringAppendable |
union | StackBufferOrFields |
UnicodeString is a string class that stores Unicode characters directly and provides similar functionality as the Java String and StringBuffer classes. It is a concrete implementation of the abstract class Replaceable (for transliteration).
The UnicodeString class is not suitable for subclassing.
For an overview of Unicode strings in C and C++ see the User Guide Strings chapter.
In ICU, a Unicode string consists of 16-bit Unicode code units. A Unicode character may be stored with either one code unit (the most common case) or with a matched pair of special code units ("surrogates"). The data type for code units is UChar. For single-character handling, a Unicode character code point is a value in the range 0..0x10ffff. ICU uses the UChar32 type for code points.
Indexes and offsets into and lengths of strings always count code units, not code points. This is the same as with multi-byte char* strings in traditional string handling. Operations on partial strings typically do not test for code point boundaries. If necessary, the user needs to take care of such boundaries by testing for the code unit values or by using functions like UnicodeString::getChar32Start() and UnicodeString::getChar32Limit() (or, in C, the equivalent macros U16_SET_CP_START() and U16_SET_CP_LIMIT(), see utf.h).
UnicodeString methods are more lenient with regard to input parameter values than other ICU APIs. In particular:
In string comparisons, two UnicodeString objects that are both "bogus" compare equal (to be transitive and prevent endless loops in sorting), and a "bogus" string compares less than any non-"bogus" one.
Const UnicodeString methods are thread-safe. Multiple threads can use const methods on the same UnicodeString object simultaneously, but non-const methods must not be called concurrently (in multiple threads) with any other (const or non-const) methods.
Similarly, const UnicodeString & parameters are thread-safe. One object may be passed in as such a parameter concurrently in multiple threads. This includes the const UnicodeString & parameters for copy construction, assignment, and cloning.
UnicodeString uses several storage methods. String contents can be stored inside the UnicodeString object itself, in an allocated and shared buffer, or in an outside buffer that is "aliased". Most of this is done transparently, but careful aliasing in particular provides significant performance improvements. Also, the internal buffer is accessible via special functions. For details see the User Guide Strings chapter.
Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor which constructs a Unicode string from an invariant-character char * string. Use the macro US_INV instead of the full qualification for this value.
Enumerator | |
---|---|
kInvariant |
|
kInvariant |
|
kInvariant |
|
Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor which constructs a Unicode string from an invariant-character char * string. Use the macro US_INV instead of the full qualification for this value.
Enumerator | |
---|---|
kInvariant |
|
kInvariant |
|
kInvariant |
|
Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor which constructs a Unicode string from an invariant-character char * string. Use the macro US_INV instead of the full qualification for this value.
Enumerator | |
---|---|
kInvariant |
|
kInvariant |
|
kInvariant |
|
|
inline |
Construct an empty UnicodeString. ICU 2.0
Construct a UnicodeString with capacity to hold capacity
UChars
capacity | the number of UChars this UnicodeString should hold before a resize is necessary; if count is greater than 0 and count code points c take up more space than capacity, then capacity is adjusted accordingly. |
c | is used to initially fill the string |
count | specifies how many code points c are to be written in the string ICU 2.0 |
UNISTR_FROM_CHAR_EXPLICIT UnicodeString::UnicodeString | ( | UChar | ch | ) |
Single UChar (code unit) constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_CHAR_EXPLICIT=explicit
on the compiler command line or similar.
ch | the character to place in the UnicodeString ICU 2.0 |
UNISTR_FROM_CHAR_EXPLICIT UnicodeString::UnicodeString | ( | UChar32 | ch | ) |
Single UChar32 (code point) constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_CHAR_EXPLICIT=explicit
on the compiler command line or similar.
ch | the character to place in the UnicodeString ICU 2.0 |
UNISTR_FROM_STRING_EXPLICIT UnicodeString::UnicodeString | ( | const UChar * | text | ) |
UChar* constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_STRING_EXPLICIT=explicit
on the compiler command line or similar.
text | The characters to place in the UnicodeString. text must be NULL (U+0000) terminated. ICU 2.0 |
UChar* constructor.
text | The characters to place in the UnicodeString. |
textLength | The number of Unicode characters in text to copy. ICU 2.0 |
Readonly-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has copy-on-write semantics: When the string is modified, then the buffer is first copied into newly allocated memory. The aliased buffer is never modified.
In an assignment to another UnicodeString, when using the copy constructor or the assignment operator, the text will be copied. When using fastCopyFrom(), the text will be aliased again, so that both strings then alias the same readonly-text.
isTerminated | specifies if text is NUL -terminated. This must be true if textLength==-1 . |
text | The characters to alias for the UnicodeString. |
textLength | The number of Unicode characters in text to alias. If -1, then this constructor will determine the length by calling u_strlen() . ICU 2.0 |
Writable-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has write-through semantics: For as long as the capacity of the buffer is sufficient, write operations will directly affect the buffer. When more capacity is necessary, then a new buffer will be allocated and the contents copied as with regularly constructed strings. In an assignment to another UnicodeString, the buffer will be copied. The extract(UChar *dst) function detects whether the dst pointer is the same as the string buffer itself and will in this case not copy the contents.
buffer | The characters to alias for the UnicodeString. |
buffLength | The number of Unicode characters in buffer to alias. |
buffCapacity | The size of buffer in UChars. ICU 2.0 |
UNISTR_FROM_STRING_EXPLICIT UnicodeString::UnicodeString | ( | const char * | codepageData | ) |
char* constructor. Uses the default converter (and thus depends on the ICU conversion code) unless U_CHARSET_IS_UTF8 is set to 1.
For ASCII (really "invariant character") strings it is more efficient to use the constructor that takes a US_INV (for its enum EInvariant). For ASCII (invariant-character) string literals, see UNICODE_STRING and UNICODE_STRING_SIMPLE.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_STRING_EXPLICIT=explicit
on the compiler command line or similar.
codepageData | an array of bytes, null-terminated, in the platform's default codepage. ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | codepageData, |
int32_t | dataLength | ||
) |
char* constructor. Uses the default converter (and thus depends on the ICU conversion code) unless U_CHARSET_IS_UTF8 is set to 1.
codepageData | an array of bytes in the platform's default codepage. |
dataLength | The number of bytes in codepageData . ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | codepageData, |
const char * | codepage | ||
) |
char* constructor.
codepageData | an array of bytes, null-terminated |
codepage | the encoding of codepageData . The special value 0 for codepage indicates that the text is in the platform's default codepage. |
If codepage
is an empty string (""
), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. Recommendation: For invariant-character strings use the constructor UnicodeString(const char *src, int32_t length, enum EInvariant inv) because it avoids object code dependencies of UnicodeString on the conversion code.
ICU 2.0
UnicodeString::UnicodeString | ( | const char * | codepageData, |
int32_t | dataLength, | ||
const char * | codepage | ||
) |
char* constructor.
codepageData | an array of bytes. |
dataLength | The number of bytes in codepageData . |
codepage | the encoding of codepageData . The special value 0 for codepage indicates that the text is in the platform's default codepage. If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. Recommendation: For invariant-character strings use the constructor UnicodeString(const char *src, int32_t length, enum EInvariant inv) because it avoids object code dependencies of UnicodeString on the conversion code. |
ICU 2.0
UnicodeString::UnicodeString | ( | const char * | src, |
int32_t | srcLength, | ||
UConverter * | cnv, | ||
UErrorCode & | errorCode | ||
) |
char * / UConverter constructor. This constructor uses an existing UConverter object to convert the codepage string to Unicode and construct a UnicodeString from that.
The converter is reset at first. If the error code indicates a failure before this constructor is called, or if an error occurs during conversion or construction, then the string will be bogus.
This function avoids the overhead of opening and closing a converter if multiple strings are constructed.
src | input codepage string |
srcLength | length of the input string, can be -1 for NUL-terminated strings |
cnv | converter object (ucnv_resetToUnicode() will be called), can be NULL for the default converter |
errorCode | normal ICU error code ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | src, |
int32_t | length, | ||
enum EInvariant | inv | ||
) |
Constructs a Unicode string from an invariant-character char * string. About invariant characters see utypes.h. This constructor has no runtime dependency on conversion code and is therefore recommended over ones taking a charset name string (where the empty string "" indicates invariant-character conversion).
Use the macro US_INV as the third, signature-distinguishing parameter.
For example:
src | String using only invariant characters. |
length | Length of src, or -1 if NUL-terminated. |
inv | Signature-distinguishing paramater, use US_INV. |
UnicodeString::UnicodeString | ( | const UnicodeString & | that | ) |
Copy constructor.
that | The UnicodeString object to copy. ICU 2.0 |
UnicodeString::UnicodeString | ( | const UnicodeString & | src, |
int32_t | srcStart | ||
) |
'Substring' constructor from tail of source string.
src | The UnicodeString object to copy. |
srcStart | The offset into src at which to start copying. ICU 2.2 |
UnicodeString::UnicodeString | ( | const UnicodeString & | src, |
int32_t | srcStart, | ||
int32_t | srcLength | ||
) |
'Substring' constructor from subrange of source string.
src | The UnicodeString object to copy. |
srcStart | The offset into src at which to start copying. |
srcLength | The number of characters from src to copy. ICU 2.2 |
|
virtual |
Destructor. ICU 2.0
|
inline |
Construct an empty UnicodeString. ICU 2.0
Construct a UnicodeString with capacity to hold capacity
UChars
capacity | the number of UChars this UnicodeString should hold before a resize is necessary; if count is greater than 0 and count code points c take up more space than capacity, then capacity is adjusted accordingly. |
c | is used to initially fill the string |
count | specifies how many code points c are to be written in the string ICU 2.0 |
UNISTR_FROM_CHAR_EXPLICIT UnicodeString::UnicodeString | ( | UChar | ch | ) |
Single UChar (code unit) constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_CHAR_EXPLICIT=explicit
on the compiler command line or similar.
ch | the character to place in the UnicodeString ICU 2.0 |
UNISTR_FROM_CHAR_EXPLICIT UnicodeString::UnicodeString | ( | UChar32 | ch | ) |
Single UChar32 (code point) constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_CHAR_EXPLICIT=explicit
on the compiler command line or similar.
ch | the character to place in the UnicodeString ICU 2.0 |
UNISTR_FROM_STRING_EXPLICIT UnicodeString::UnicodeString | ( | const UChar * | text | ) |
UChar* constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_STRING_EXPLICIT=explicit
on the compiler command line or similar.
text | The characters to place in the UnicodeString. text must be NULL (U+0000) terminated. ICU 2.0 |
UChar* constructor.
text | The characters to place in the UnicodeString. |
textLength | The number of Unicode characters in text to copy. ICU 2.0 |
Readonly-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has copy-on-write semantics: When the string is modified, then the buffer is first copied into newly allocated memory. The aliased buffer is never modified.
In an assignment to another UnicodeString, when using the copy constructor or the assignment operator, the text will be copied. When using fastCopyFrom(), the text will be aliased again, so that both strings then alias the same readonly-text.
isTerminated | specifies if text is NUL -terminated. This must be true if textLength==-1 . |
text | The characters to alias for the UnicodeString. |
textLength | The number of Unicode characters in text to alias. If -1, then this constructor will determine the length by calling u_strlen() . ICU 2.0 |
Writable-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has write-through semantics: For as long as the capacity of the buffer is sufficient, write operations will directly affect the buffer. When more capacity is necessary, then a new buffer will be allocated and the contents copied as with regularly constructed strings. In an assignment to another UnicodeString, the buffer will be copied. The extract(UChar *dst) function detects whether the dst pointer is the same as the string buffer itself and will in this case not copy the contents.
buffer | The characters to alias for the UnicodeString. |
buffLength | The number of Unicode characters in buffer to alias. |
buffCapacity | The size of buffer in UChars. ICU 2.0 |
UNISTR_FROM_STRING_EXPLICIT UnicodeString::UnicodeString | ( | const char * | codepageData | ) |
char* constructor. Uses the default converter (and thus depends on the ICU conversion code) unless U_CHARSET_IS_UTF8 is set to 1.
For ASCII (really "invariant character") strings it is more efficient to use the constructor that takes a US_INV (for its enum EInvariant). For ASCII (invariant-character) string literals, see UNICODE_STRING and UNICODE_STRING_SIMPLE.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_STRING_EXPLICIT=explicit
on the compiler command line or similar.
codepageData | an array of bytes, null-terminated, in the platform's default codepage. ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | codepageData, |
int32_t | dataLength | ||
) |
char* constructor. Uses the default converter (and thus depends on the ICU conversion code) unless U_CHARSET_IS_UTF8 is set to 1.
codepageData | an array of bytes in the platform's default codepage. |
dataLength | The number of bytes in codepageData . ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | codepageData, |
const char * | codepage | ||
) |
char* constructor.
codepageData | an array of bytes, null-terminated |
codepage | the encoding of codepageData . The special value 0 for codepage indicates that the text is in the platform's default codepage. |
If codepage
is an empty string (""
), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. Recommendation: For invariant-character strings use the constructor UnicodeString(const char *src, int32_t length, enum EInvariant inv) because it avoids object code dependencies of UnicodeString on the conversion code.
ICU 2.0
UnicodeString::UnicodeString | ( | const char * | codepageData, |
int32_t | dataLength, | ||
const char * | codepage | ||
) |
char* constructor.
codepageData | an array of bytes. |
dataLength | The number of bytes in codepageData . |
codepage | the encoding of codepageData . The special value 0 for codepage indicates that the text is in the platform's default codepage. If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. Recommendation: For invariant-character strings use the constructor UnicodeString(const char *src, int32_t length, enum EInvariant inv) because it avoids object code dependencies of UnicodeString on the conversion code. |
ICU 2.0
UnicodeString::UnicodeString | ( | const char * | src, |
int32_t | srcLength, | ||
UConverter * | cnv, | ||
UErrorCode & | errorCode | ||
) |
char * / UConverter constructor. This constructor uses an existing UConverter object to convert the codepage string to Unicode and construct a UnicodeString from that.
The converter is reset at first. If the error code indicates a failure before this constructor is called, or if an error occurs during conversion or construction, then the string will be bogus.
This function avoids the overhead of opening and closing a converter if multiple strings are constructed.
src | input codepage string |
srcLength | length of the input string, can be -1 for NUL-terminated strings |
cnv | converter object (ucnv_resetToUnicode() will be called), can be NULL for the default converter |
errorCode | normal ICU error code ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | src, |
int32_t | length, | ||
enum EInvariant | inv | ||
) |
Constructs a Unicode string from an invariant-character char * string. About invariant characters see utypes.h. This constructor has no runtime dependency on conversion code and is therefore recommended over ones taking a charset name string (where the empty string "" indicates invariant-character conversion).
Use the macro US_INV as the third, signature-distinguishing parameter.
For example:
src | String using only invariant characters. |
length | Length of src, or -1 if NUL-terminated. |
inv | Signature-distinguishing paramater, use US_INV. |
UnicodeString::UnicodeString | ( | const UnicodeString & | that | ) |
Copy constructor.
that | The UnicodeString object to copy. ICU 2.0 |
UnicodeString::UnicodeString | ( | const UnicodeString & | src, |
int32_t | srcStart | ||
) |
'Substring' constructor from tail of source string.
src | The UnicodeString object to copy. |
srcStart | The offset into src at which to start copying. ICU 2.2 |
UnicodeString::UnicodeString | ( | const UnicodeString & | src, |
int32_t | srcStart, | ||
int32_t | srcLength | ||
) |
'Substring' constructor from subrange of source string.
src | The UnicodeString object to copy. |
srcStart | The offset into src at which to start copying. |
srcLength | The number of characters from src to copy. ICU 2.2 |
|
virtual |
Destructor. ICU 2.0
|
inline |
Construct an empty UnicodeString. ICU 2.0
Construct a UnicodeString with capacity to hold capacity
UChars
capacity | the number of UChars this UnicodeString should hold before a resize is necessary; if count is greater than 0 and count code points c take up more space than capacity, then capacity is adjusted accordingly. |
c | is used to initially fill the string |
count | specifies how many code points c are to be written in the string ICU 2.0 |
UNISTR_FROM_CHAR_EXPLICIT UnicodeString::UnicodeString | ( | UChar | ch | ) |
Single UChar (code unit) constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_CHAR_EXPLICIT=explicit
on the compiler command line or similar.
ch | the character to place in the UnicodeString ICU 2.0 |
UNISTR_FROM_CHAR_EXPLICIT UnicodeString::UnicodeString | ( | UChar32 | ch | ) |
Single UChar32 (code point) constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_CHAR_EXPLICIT=explicit
on the compiler command line or similar.
ch | the character to place in the UnicodeString ICU 2.0 |
UNISTR_FROM_STRING_EXPLICIT UnicodeString::UnicodeString | ( | const UChar * | text | ) |
UChar* constructor.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_STRING_EXPLICIT=explicit
on the compiler command line or similar.
text | The characters to place in the UnicodeString. text must be NULL (U+0000) terminated. ICU 2.0 |
UChar* constructor.
text | The characters to place in the UnicodeString. |
textLength | The number of Unicode characters in text to copy. ICU 2.0 |
Readonly-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has copy-on-write semantics: When the string is modified, then the buffer is first copied into newly allocated memory. The aliased buffer is never modified.
In an assignment to another UnicodeString, when using the copy constructor or the assignment operator, the text will be copied. When using fastCopyFrom(), the text will be aliased again, so that both strings then alias the same readonly-text.
isTerminated | specifies if text is NUL -terminated. This must be true if textLength==-1 . |
text | The characters to alias for the UnicodeString. |
textLength | The number of Unicode characters in text to alias. If -1, then this constructor will determine the length by calling u_strlen() . ICU 2.0 |
Writable-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has write-through semantics: For as long as the capacity of the buffer is sufficient, write operations will directly affect the buffer. When more capacity is necessary, then a new buffer will be allocated and the contents copied as with regularly constructed strings. In an assignment to another UnicodeString, the buffer will be copied. The extract(UChar *dst) function detects whether the dst pointer is the same as the string buffer itself and will in this case not copy the contents.
buffer | The characters to alias for the UnicodeString. |
buffLength | The number of Unicode characters in buffer to alias. |
buffCapacity | The size of buffer in UChars. ICU 2.0 |
UNISTR_FROM_STRING_EXPLICIT UnicodeString::UnicodeString | ( | const char * | codepageData | ) |
char* constructor. Uses the default converter (and thus depends on the ICU conversion code) unless U_CHARSET_IS_UTF8 is set to 1.
For ASCII (really "invariant character") strings it is more efficient to use the constructor that takes a US_INV (for its enum EInvariant). For ASCII (invariant-character) string literals, see UNICODE_STRING and UNICODE_STRING_SIMPLE.
It is recommended to mark this constructor "explicit" by -DUNISTR_FROM_STRING_EXPLICIT=explicit
on the compiler command line or similar.
codepageData | an array of bytes, null-terminated, in the platform's default codepage. ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | codepageData, |
int32_t | dataLength | ||
) |
char* constructor. Uses the default converter (and thus depends on the ICU conversion code) unless U_CHARSET_IS_UTF8 is set to 1.
codepageData | an array of bytes in the platform's default codepage. |
dataLength | The number of bytes in codepageData . ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | codepageData, |
const char * | codepage | ||
) |
char* constructor.
codepageData | an array of bytes, null-terminated |
codepage | the encoding of codepageData . The special value 0 for codepage indicates that the text is in the platform's default codepage. |
If codepage
is an empty string (""
), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. Recommendation: For invariant-character strings use the constructor UnicodeString(const char *src, int32_t length, enum EInvariant inv) because it avoids object code dependencies of UnicodeString on the conversion code.
ICU 2.0
UnicodeString::UnicodeString | ( | const char * | codepageData, |
int32_t | dataLength, | ||
const char * | codepage | ||
) |
char* constructor.
codepageData | an array of bytes. |
dataLength | The number of bytes in codepageData . |
codepage | the encoding of codepageData . The special value 0 for codepage indicates that the text is in the platform's default codepage. If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. Recommendation: For invariant-character strings use the constructor UnicodeString(const char *src, int32_t length, enum EInvariant inv) because it avoids object code dependencies of UnicodeString on the conversion code. |
ICU 2.0
UnicodeString::UnicodeString | ( | const char * | src, |
int32_t | srcLength, | ||
UConverter * | cnv, | ||
UErrorCode & | errorCode | ||
) |
char * / UConverter constructor. This constructor uses an existing UConverter object to convert the codepage string to Unicode and construct a UnicodeString from that.
The converter is reset at first. If the error code indicates a failure before this constructor is called, or if an error occurs during conversion or construction, then the string will be bogus.
This function avoids the overhead of opening and closing a converter if multiple strings are constructed.
src | input codepage string |
srcLength | length of the input string, can be -1 for NUL-terminated strings |
cnv | converter object (ucnv_resetToUnicode() will be called), can be NULL for the default converter |
errorCode | normal ICU error code ICU 2.0 |
UnicodeString::UnicodeString | ( | const char * | src, |
int32_t | length, | ||
enum EInvariant | inv | ||
) |
Constructs a Unicode string from an invariant-character char * string. About invariant characters see utypes.h. This constructor has no runtime dependency on conversion code and is therefore recommended over ones taking a charset name string (where the empty string "" indicates invariant-character conversion).
Use the macro US_INV as the third, signature-distinguishing parameter.
For example:
src | String using only invariant characters. |
length | Length of src, or -1 if NUL-terminated. |
inv | Signature-distinguishing paramater, use US_INV. |
UnicodeString::UnicodeString | ( | const UnicodeString & | that | ) |
Copy constructor.
that | The UnicodeString object to copy. ICU 2.0 |
UnicodeString::UnicodeString | ( | const UnicodeString & | src, |
int32_t | srcStart | ||
) |
'Substring' constructor from tail of source string.
src | The UnicodeString object to copy. |
srcStart | The offset into src at which to start copying. ICU 2.2 |
UnicodeString::UnicodeString | ( | const UnicodeString & | src, |
int32_t | srcStart, | ||
int32_t | srcLength | ||
) |
'Substring' constructor from subrange of source string.
src | The UnicodeString object to copy. |
srcStart | The offset into src at which to start copying. |
srcLength | The number of characters from src to copy. ICU 2.2 |
|
virtual |
Destructor. ICU 2.0
|
inline |
Append the characters in srcText
in the range [srcStart
, srcStart + srcLength
) to the UnicodeString object at offset start
. srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the append string |
|
inline |
Append the characters in srcText
in the range [srcStart
, srcStart + srcLength
) to the UnicodeString object at offset start
. srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the append string |
|
inline |
Append the characters in srcText
in the range [srcStart
, srcStart + srcLength
) to the UnicodeString object at offset start
. srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the append string |
|
inline |
Append the characters in srcText
to the UnicodeString object. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Append the characters in srcText
to the UnicodeString object. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Append the characters in srcText
to the UnicodeString object. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Append the characters in srcChars
in the range [srcStart
, srcStart + srcLength
) to the UnicodeString object at offset start
. srcChars
is not modified.
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the append string; can be -1 if srcChars is NUL-terminated |
|
inline |
Append the characters in srcChars
in the range [srcStart
, srcStart + srcLength
) to the UnicodeString object at offset start
. srcChars
is not modified.
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the append string; can be -1 if srcChars is NUL-terminated |
|
inline |
Append the characters in srcChars
in the range [srcStart
, srcStart + srcLength
) to the UnicodeString object at offset start
. srcChars
is not modified.
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the append string; can be -1 if srcChars is NUL-terminated |
|
inline |
Append the characters in srcChars
to the UnicodeString object at offset start
. srcChars
is not modified.
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars ; can be -1 if srcChars is NUL-terminated |
|
inline |
Append the characters in srcChars
to the UnicodeString object at offset start
. srcChars
is not modified.
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars ; can be -1 if srcChars is NUL-terminated |
|
inline |
Append the characters in srcChars
to the UnicodeString object at offset start
. srcChars
is not modified.
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars ; can be -1 if srcChars is NUL-terminated |
|
inline |
Append the code unit srcChar
to the UnicodeString object.
srcChar | the code unit to append |
|
inline |
Append the code unit srcChar
to the UnicodeString object.
srcChar | the code unit to append |
|
inline |
Append the code unit srcChar
to the UnicodeString object.
srcChar | the code unit to append |
UnicodeString& UnicodeString::append | ( | UChar32 | srcChar | ) |
Append the code point srcChar
to the UnicodeString object.
srcChar | the code point to append |
UnicodeString& UnicodeString::append | ( | UChar32 | srcChar | ) |
Append the code point srcChar
to the UnicodeString object.
srcChar | the code point to append |
UnicodeString& UnicodeString::append | ( | UChar32 | srcChar | ) |
Append the code point srcChar
to the UnicodeString object.
srcChar | the code point to append |
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(text.foldCase(options)).
text | Another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(text.foldCase(options)).
text | Another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(text.foldCase(options)).
text | Another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
srcChars | A pointer to another string to compare this one to. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
srcChars | A pointer to another string to compare this one to. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
srcChars | A pointer to another string to compare this one to. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compareBetween(text.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
limit | The offset after the last code unit from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLimit | The offset after the last code unit from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compareBetween(text.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
limit | The offset after the last code unit from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLimit | The offset after the last code unit from that string to compare. |
options | A bit set of options:
|
|
inline |
Compare two strings case-insensitively using full case folding. This is equivalent to this->foldCase(options).compareBetween(text.foldCase(options)).
start | The start offset in this string at which the compare operation begins. |
limit | The offset after the last code unit from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLimit | The offset after the last code unit from that string to compare. |
options | A bit set of options:
|
Return the code point that contains the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text that indicates the text offset of any of the code units that will be assembled into a code point (21-bit value) and returned |
offset
or 0xffff if the offset is not valid for this string ICU 2.0 Return the code point that contains the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text that indicates the text offset of any of the code units that will be assembled into a code point (21-bit value) and returned |
offset
or 0xffff if the offset is not valid for this string ICU 2.0 Return the code point that contains the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text that indicates the text offset of any of the code units that will be assembled into a code point (21-bit value) and returned |
offset
or 0xffff if the offset is not valid for this string ICU 2.0 Return the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text |
offset
or 0xffff if the offset is not valid for this string ICU 2.0 Return the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text |
offset
or 0xffff if the offset is not valid for this string ICU 2.0 Return the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text |
offset
or 0xffff if the offset is not valid for this string ICU 2.0
|
virtual |
Clone this object, an instance of a subclass of Replaceable. Clones can be used concurrently in multiple threads. If a subclass does not implement clone(), or if an error occurs, then NULL is returned. The clone functions in all subclasses return a pointer to a Replaceable because some compilers do not support covariant (same-as-this) return types; cast to the appropriate subclass if necessary. The caller must delete the clone.
Reimplemented from Replaceable.
|
virtual |
Clone this object, an instance of a subclass of Replaceable. Clones can be used concurrently in multiple threads. If a subclass does not implement clone(), or if an error occurs, then NULL is returned. The clone functions in all subclasses return a pointer to a Replaceable because some compilers do not support covariant (same-as-this) return types; cast to the appropriate subclass if necessary. The caller must delete the clone.
Reimplemented from Replaceable.
|
virtual |
Clone this object, an instance of a subclass of Replaceable. Clones can be used concurrently in multiple threads. If a subclass does not implement clone(), or if an error occurs, then NULL is returned. The clone functions in all subclasses return a pointer to a Replaceable because some compilers do not support covariant (same-as-this) return types; cast to the appropriate subclass if necessary. The caller must delete the clone.
Reimplemented from Replaceable.
|
inline |
Compare the characters bitwise in this UnicodeString to the characters in text
.
text | The UnicodeString to compare to this one. |
text
, -1 if the characters in this are bitwise less than the characters in text
, +1 if the characters in this are bitwise greater than the characters in text
. ICU 2.0
|
inline |
Compare the characters bitwise in this UnicodeString to the characters in text
.
text | The UnicodeString to compare to this one. |
text
, -1 if the characters in this are bitwise less than the characters in text
, +1 if the characters in this are bitwise greater than the characters in text
. ICU 2.0
|
inline |
Compare the characters bitwise in this UnicodeString to the characters in text
.
text | The UnicodeString to compare to this one. |
text
, -1 if the characters in this are bitwise less than the characters in text
, +1 if the characters in this are bitwise greater than the characters in text
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in the entire string text
. (The parameters "start" and "length" are not applied to the other text "text".)
start | the offset at which the compare operation begins |
length | the number of characters of text to compare. |
text | the other text to be compared against this string. |
text
, -1 if the characters in this are bitwise less than the characters in text
, +1 if the characters in this are bitwise greater than the characters in text
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in the entire string text
. (The parameters "start" and "length" are not applied to the other text "text".)
start | the offset at which the compare operation begins |
length | the number of characters of text to compare. |
text | the other text to be compared against this string. |
text
, -1 if the characters in this are bitwise less than the characters in text
, +1 if the characters in this are bitwise greater than the characters in text
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in the entire string text
. (The parameters "start" and "length" are not applied to the other text "text".)
start | the offset at which the compare operation begins |
length | the number of characters of text to compare. |
text | the other text to be compared against this string. |
text
, -1 if the characters in this are bitwise less than the characters in text
, +1 if the characters in this are bitwise greater than the characters in text
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
start | the offset at which the compare operation begins |
length | the number of characters in this to compare. |
srcText | the text to be compared |
srcStart | the offset into srcText to start comparison |
srcLength | the number of characters in src to compare |
srcText
, -1 if the characters in this are bitwise less than the characters in srcText
, +1 if the characters in this are bitwise greater than the characters in srcText
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
start | the offset at which the compare operation begins |
length | the number of characters in this to compare. |
srcText | the text to be compared |
srcStart | the offset into srcText to start comparison |
srcLength | the number of characters in src to compare |
srcText
, -1 if the characters in this are bitwise less than the characters in srcText
, +1 if the characters in this are bitwise greater than the characters in srcText
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
start | the offset at which the compare operation begins |
length | the number of characters in this to compare. |
srcText | the text to be compared |
srcStart | the offset into srcText to start comparison |
srcLength | the number of characters in src to compare |
srcText
, -1 if the characters in this are bitwise less than the characters in srcText
, +1 if the characters in this are bitwise greater than the characters in srcText
. ICU 2.0 Compare the characters bitwise in this UnicodeString with the first srcLength
characters in srcChars
.
srcChars | The characters to compare to this UnicodeString. |
srcLength | the number of characters in srcChars to compare |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0 Compare the characters bitwise in this UnicodeString with the first srcLength
characters in srcChars
.
srcChars | The characters to compare to this UnicodeString. |
srcLength | the number of characters in srcChars to compare |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0 Compare the characters bitwise in this UnicodeString with the first srcLength
characters in srcChars
.
srcChars | The characters to compare to this UnicodeString. |
srcLength | the number of characters in srcChars to compare |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the first length
characters in srcChars
start | the offset at which the compare operation begins |
length | the number of characters to compare. |
srcChars | the characters to be compared |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the first length
characters in srcChars
start | the offset at which the compare operation begins |
length | the number of characters to compare. |
srcChars | the characters to be compared |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the first length
characters in srcChars
start | the offset at which the compare operation begins |
length | the number of characters to compare. |
srcChars | the characters to be compared |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
start | the offset at which the compare operation begins |
length | the number of characters in this to compare |
srcChars | the characters to be compared |
srcStart | the offset into srcChars to start comparison |
srcLength | the number of characters in srcChars to compare |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
start | the offset at which the compare operation begins |
length | the number of characters in this to compare |
srcChars | the characters to be compared |
srcStart | the offset into srcChars to start comparison |
srcLength | the number of characters in srcChars to compare |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, start + length
) with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
start | the offset at which the compare operation begins |
length | the number of characters in this to compare |
srcChars | the characters to be compared |
srcStart | the offset into srcChars to start comparison |
srcLength | the number of characters in srcChars to compare |
srcChars
, -1 if the characters in this are bitwise less than the characters in srcChars
, +1 if the characters in this are bitwise greater than the characters in srcChars
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, limit
) with the characters in srcText
in the range [srcStart
, srcLimit
).
start | the offset at which the compare operation begins |
limit | the offset immediately following the compare operation |
srcText | the text to be compared |
srcStart | the offset into srcText to start comparison |
srcLimit | the offset into srcText to limit comparison |
srcText
, -1 if the characters in this are bitwise less than the characters in srcText
, +1 if the characters in this are bitwise greater than the characters in srcText
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, limit
) with the characters in srcText
in the range [srcStart
, srcLimit
).
start | the offset at which the compare operation begins |
limit | the offset immediately following the compare operation |
srcText | the text to be compared |
srcStart | the offset into srcText to start comparison |
srcLimit | the offset into srcText to limit comparison |
srcText
, -1 if the characters in this are bitwise less than the characters in srcText
, +1 if the characters in this are bitwise greater than the characters in srcText
. ICU 2.0
|
inline |
Compare the characters bitwise in the range [start
, limit
) with the characters in srcText
in the range [srcStart
, srcLimit
).
start | the offset at which the compare operation begins |
limit | the offset immediately following the compare operation |
srcText | the text to be compared |
srcStart | the offset into srcText to start comparison |
srcLimit | the offset into srcText to limit comparison |
srcText
, -1 if the characters in this are bitwise less than the characters in srcText
, +1 if the characters in this are bitwise greater than the characters in srcText
. ICU 2.0
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
text | Another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
text | Another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
text | Another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
srcChars | A pointer to another string to compare this one to. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
srcChars | A pointer to another string to compare this one to. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
srcChars | A pointer to another string to compare this one to. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
length | The number of code units from this string to compare. |
srcChars | A pointer to another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLength | The number of code units from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
limit | The offset after the last code unit from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLimit | The offset after the last code unit from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
limit | The offset after the last code unit from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLimit | The offset after the last code unit from that string to compare. |
|
inline |
Compare two Unicode strings in code point order. The result may be different from the results of compare(), operator<, etc. if supplementary characters are present:
In UTF-16, supplementary characters (with code points U+10000 and above) are stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff, which means that they compare as less than some other BMP characters like U+feff. This function compares Unicode strings in code point order. If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
start | The start offset in this string at which the compare operation begins. |
limit | The offset after the last code unit from this string to compare. |
srcText | Another string to compare this one to. |
srcStart | The start offset in that string at which the compare operation begins. |
srcLimit | The offset after the last code unit from that string to compare. |
Copy a substring of this object, retaining attribute (out-of-band) information. This method is used to duplicate or reorder substrings. The destination index must not overlap the source range.
start | the beginning index, inclusive; 0 <= start <= limit . |
limit | the ending index, exclusive; start <= limit <= length() . |
dest | the destination index. The characters from start..limit-1 will be copied to dest . Implementations of this method may assume that dest <= start || dest >= limit . ICU 2.0 |
Implements Replaceable.
Copy a substring of this object, retaining attribute (out-of-band) information. This method is used to duplicate or reorder substrings. The destination index must not overlap the source range.
start | the beginning index, inclusive; 0 <= start <= limit . |
limit | the ending index, exclusive; start <= limit <= length() . |
dest | the destination index. The characters from start..limit-1 will be copied to dest . Implementations of this method may assume that dest <= start || dest >= limit . ICU 2.0 |
Implements Replaceable.
Copy a substring of this object, retaining attribute (out-of-band) information. This method is used to duplicate or reorder substrings. The destination index must not overlap the source range.
start | the beginning index, inclusive; 0 <= start <= limit . |
limit | the ending index, exclusive; start <= limit <= length() . |
dest | the destination index. The characters from start..limit-1 will be copied to dest . Implementations of this method may assume that dest <= start || dest >= limit . ICU 2.0 |
Implements Replaceable.
Count Unicode code points in the length UChar code units of the string. A code point may occupy either one or two UChar code units. Counting code points involves reading all code units.
This functions is basically the inverse of moveIndex32().
start | the index of the first code unit to check |
length | the number of UChar code units to check |
Count Unicode code points in the length UChar code units of the string. A code point may occupy either one or two UChar code units. Counting code points involves reading all code units.
This functions is basically the inverse of moveIndex32().
start | the index of the first code unit to check |
length | the number of UChar code units to check |
Count Unicode code points in the length UChar code units of the string. A code point may occupy either one or two UChar code units. Counting code points involves reading all code units.
This functions is basically the inverse of moveIndex32().
start | the index of the first code unit to check |
length | the number of UChar code units to check |
|
inline |
Determine if this ends with the characters in text
text | The text to match. |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in text
text | The text to match. |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in text
text | The text to match. |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
srcText | The text to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcText to match |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
srcText | The text to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcText to match |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
srcText | The text to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcText to match |
text
, FALSE otherwise ICU 2.0 Determine if this ends with the characters in srcChars
srcChars | The characters to match. |
srcLength | the number of characters in srcChars |
srcChars
, FALSE otherwise ICU 2.0 Determine if this ends with the characters in srcChars
srcChars | The characters to match. |
srcLength | the number of characters in srcChars |
srcChars
, FALSE otherwise ICU 2.0 Determine if this ends with the characters in srcChars
srcChars | The characters to match. |
srcLength | the number of characters in srcChars |
srcChars
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
srcChars | The characters to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcChars to match |
srcChars
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
srcChars | The characters to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcChars to match |
srcChars
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
srcChars | The characters to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcChars to match |
srcChars
, FALSE otherwise ICU 2.0
|
inline |
Copy the characters in the range [start
, start + length
) into the array dst
, beginning at dstStart
. If the string aliases to dst
itself as an external buffer, then extract() will not copy the contents.
start | offset of first character which will be copied into the array |
length | the number of characters to extract |
dst | array in which to copy characters. The length of dst must be at least (dstStart + length ). |
dstStart | the offset in dst where the first character will be extracted ICU 2.0 |
|
inline |
Copy the characters in the range [start
, start + length
) into the array dst
, beginning at dstStart
. If the string aliases to dst
itself as an external buffer, then extract() will not copy the contents.
start | offset of first character which will be copied into the array |
length | the number of characters to extract |
dst | array in which to copy characters. The length of dst must be at least (dstStart + length ). |
dstStart | the offset in dst where the first character will be extracted ICU 2.0 |
|
inline |
Copy the characters in the range [start
, start + length
) into the array dst
, beginning at dstStart
. If the string aliases to dst
itself as an external buffer, then extract() will not copy the contents.
start | offset of first character which will be copied into the array |
length | the number of characters to extract |
dst | array in which to copy characters. The length of dst must be at least (dstStart + length ). |
dstStart | the offset in dst where the first character will be extracted ICU 2.0 |
int32_t UnicodeString::extract | ( | UChar * | dest, |
int32_t | destCapacity, | ||
UErrorCode & | errorCode | ||
) | const |
Copy the contents of the string into dest. This is a convenience function that checks if there is enough space in dest, extracts the entire string if possible, and NUL-terminates dest if possible.
If the string fits into dest but cannot be NUL-terminated (length()==destCapacity) then the error code is set to U_STRING_NOT_TERMINATED_WARNING. If the string itself does not fit into dest (length()>destCapacity) then the error code is set to U_BUFFER_OVERFLOW_ERROR.
If the string aliases to dest
itself as an external buffer, then extract() will not copy the contents.
dest | Destination string buffer. |
destCapacity | Number of UChars available at dest. |
errorCode | ICU error code. |
int32_t UnicodeString::extract | ( | UChar * | dest, |
int32_t | destCapacity, | ||
UErrorCode & | errorCode | ||
) | const |
Copy the contents of the string into dest. This is a convenience function that checks if there is enough space in dest, extracts the entire string if possible, and NUL-terminates dest if possible.
If the string fits into dest but cannot be NUL-terminated (length()==destCapacity) then the error code is set to U_STRING_NOT_TERMINATED_WARNING. If the string itself does not fit into dest (length()>destCapacity) then the error code is set to U_BUFFER_OVERFLOW_ERROR.
If the string aliases to dest
itself as an external buffer, then extract() will not copy the contents.
dest | Destination string buffer. |
destCapacity | Number of UChars available at dest. |
errorCode | ICU error code. |
int32_t UnicodeString::extract | ( | UChar * | dest, |
int32_t | destCapacity, | ||
UErrorCode & | errorCode | ||
) | const |
Copy the contents of the string into dest. This is a convenience function that checks if there is enough space in dest, extracts the entire string if possible, and NUL-terminates dest if possible.
If the string fits into dest but cannot be NUL-terminated (length()==destCapacity) then the error code is set to U_STRING_NOT_TERMINATED_WARNING. If the string itself does not fit into dest (length()>destCapacity) then the error code is set to U_BUFFER_OVERFLOW_ERROR.
If the string aliases to dest
itself as an external buffer, then extract() will not copy the contents.
dest | Destination string buffer. |
destCapacity | Number of UChars available at dest. |
errorCode | ICU error code. |
|
inline |
Copy the characters in the range [start
, start + length
) into the UnicodeString target
.
start | offset of first character which will be copied |
length | the number of characters to extract |
target | UnicodeString into which to copy characters. |
target
ICU 2.0
|
inline |
Copy the characters in the range [start
, start + length
) into the UnicodeString target
.
start | offset of first character which will be copied |
length | the number of characters to extract |
target | UnicodeString into which to copy characters. |
target
ICU 2.0
|
inline |
Copy the characters in the range [start
, start + length
) into the UnicodeString target
.
start | offset of first character which will be copied |
length | the number of characters to extract |
target | UnicodeString into which to copy characters. |
target
ICU 2.0 int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
int32_t | targetCapacity, | ||
enum EInvariant | inv | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters. All characters must be invariant (see utypes.h). Use US_INV as the last, signature-distinguishing parameter.
This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction, can be NULL if targetLength is 0 |
targetCapacity | the length of the target buffer |
inv | Signature-distinguishing paramater, use US_INV. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
int32_t | targetCapacity, | ||
enum EInvariant | inv | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters. All characters must be invariant (see utypes.h). Use US_INV as the last, signature-distinguishing parameter.
This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction, can be NULL if targetLength is 0 |
targetCapacity | the length of the target buffer |
inv | Signature-distinguishing paramater, use US_INV. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
int32_t | targetCapacity, | ||
enum EInvariant | inv | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters. All characters must be invariant (see utypes.h). Use US_INV as the last, signature-distinguishing parameter.
This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction, can be NULL if targetLength is 0 |
targetCapacity | the length of the target buffer |
inv | Signature-distinguishing paramater, use US_INV. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
uint32_t | targetLength | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters in the platform's default codepage. This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
targetLength | the length of the target buffer If target is NULL, then the number of bytes required for target is returned. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
uint32_t | targetLength | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters in the platform's default codepage. This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
targetLength | the length of the target buffer If target is NULL, then the number of bytes required for target is returned. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
uint32_t | targetLength | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters in the platform's default codepage. This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
targetLength | the length of the target buffer If target is NULL, then the number of bytes required for target is returned. |
|
inline |
Copy the characters in the range [start
, start + length
) into an array of characters in a specified codepage. The output string is NUL-terminated.
Recommendation: For invariant-character strings use extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const because it avoids object code dependencies of UnicodeString on the conversion code.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
codepage | the desired codepage for the characters. 0 has the special meaning of the default codepage If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. If target is NULL, then the number of bytes required for target is returned. It is assumed that the target is big enough to fit all of the characters. |
|
inline |
Copy the characters in the range [start
, start + length
) into an array of characters in a specified codepage. The output string is NUL-terminated.
Recommendation: For invariant-character strings use extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const because it avoids object code dependencies of UnicodeString on the conversion code.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
codepage | the desired codepage for the characters. 0 has the special meaning of the default codepage If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. If target is NULL, then the number of bytes required for target is returned. It is assumed that the target is big enough to fit all of the characters. |
|
inline |
Copy the characters in the range [start
, start + length
) into an array of characters in a specified codepage. The output string is NUL-terminated.
Recommendation: For invariant-character strings use extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const because it avoids object code dependencies of UnicodeString on the conversion code.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
codepage | the desired codepage for the characters. 0 has the special meaning of the default codepage If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. If target is NULL, then the number of bytes required for target is returned. It is assumed that the target is big enough to fit all of the characters. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
uint32_t | targetLength, | ||
const char * | codepage | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters in a specified codepage. This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
Recommendation: For invariant-character strings use extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const because it avoids object code dependencies of UnicodeString on the conversion code.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
targetLength | the length of the target buffer |
codepage | the desired codepage for the characters. 0 has the special meaning of the default codepage If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. If target is NULL, then the number of bytes required for target is returned. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
uint32_t | targetLength, | ||
const char * | codepage | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters in a specified codepage. This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
Recommendation: For invariant-character strings use extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const because it avoids object code dependencies of UnicodeString on the conversion code.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
targetLength | the length of the target buffer |
codepage | the desired codepage for the characters. 0 has the special meaning of the default codepage If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. If target is NULL, then the number of bytes required for target is returned. |
int32_t UnicodeString::extract | ( | int32_t | start, |
int32_t | startLength, | ||
char * | target, | ||
uint32_t | targetLength, | ||
const char * | codepage | ||
) | const |
Copy the characters in the range [start
, start + length
) into an array of characters in a specified codepage. This function does not write any more than targetLength
characters but returns the length of the entire output string so that one can allocate a larger buffer and call the function again if necessary. The output string is NUL-terminated if possible.
Recommendation: For invariant-character strings use extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const because it avoids object code dependencies of UnicodeString on the conversion code.
start | offset of first character which will be copied |
startLength | the number of characters to extract |
target | the target buffer for extraction |
targetLength | the length of the target buffer |
codepage | the desired codepage for the characters. 0 has the special meaning of the default codepage If codepage is an empty string ("" ), then a simple conversion is performed on the codepage-invariant subset ("invariant characters") of the platform encoding. See utypes.h. If target is NULL, then the number of bytes required for target is returned. |
int32_t UnicodeString::extract | ( | char * | dest, |
int32_t | destCapacity, | ||
UConverter * | cnv, | ||
UErrorCode & | errorCode | ||
) | const |
Convert the UnicodeString into a codepage string using an existing UConverter. The output string is NUL-terminated if possible.
This function avoids the overhead of opening and closing a converter if multiple strings are extracted.
dest | destination string buffer, can be NULL if destCapacity==0 |
destCapacity | the number of chars available at dest |
cnv | the converter object to be used (ucnv_resetFromUnicode() will be called), or NULL for the default converter |
errorCode | normal ICU error code |
int32_t UnicodeString::extract | ( | char * | dest, |
int32_t | destCapacity, | ||
UConverter * | cnv, | ||
UErrorCode & | errorCode | ||
) | const |
Convert the UnicodeString into a codepage string using an existing UConverter. The output string is NUL-terminated if possible.
This function avoids the overhead of opening and closing a converter if multiple strings are extracted.
dest | destination string buffer, can be NULL if destCapacity==0 |
destCapacity | the number of chars available at dest |
cnv | the converter object to be used (ucnv_resetFromUnicode() will be called), or NULL for the default converter |
errorCode | normal ICU error code |
int32_t UnicodeString::extract | ( | char * | dest, |
int32_t | destCapacity, | ||
UConverter * | cnv, | ||
UErrorCode & | errorCode | ||
) | const |
Convert the UnicodeString into a codepage string using an existing UConverter. The output string is NUL-terminated if possible.
This function avoids the overhead of opening and closing a converter if multiple strings are extracted.
dest | destination string buffer, can be NULL if destCapacity==0 |
destCapacity | the number of chars available at dest |
cnv | the converter object to be used (ucnv_resetFromUnicode() will be called), or NULL for the default converter |
errorCode | normal ICU error code |
|
inline |
Copy the characters in the range [start
, limit
) into the array dst
, beginning at dstStart
.
start | offset of first character which will be copied into the array |
limit | offset immediately following the last character to be copied |
dst | array in which to copy characters. The length of dst must be at least (dstStart + (limit - start) ). |
dstStart | the offset in dst where the first character will be extracted ICU 2.0 |
|
inline |
Copy the characters in the range [start
, limit
) into the array dst
, beginning at dstStart
.
start | offset of first character which will be copied into the array |
limit | offset immediately following the last character to be copied |
dst | array in which to copy characters. The length of dst must be at least (dstStart + (limit - start) ). |
dstStart | the offset in dst where the first character will be extracted ICU 2.0 |
|
inline |
Copy the characters in the range [start
, limit
) into the array dst
, beginning at dstStart
.
start | offset of first character which will be copied into the array |
limit | offset immediately following the last character to be copied |
dst | array in which to copy characters. The length of dst must be at least (dstStart + (limit - start) ). |
dstStart | the offset in dst where the first character will be extracted ICU 2.0 |
|
virtual |
Copy the characters in the range [start
, limit
) into the UnicodeString target
. Replaceable API.
start | offset of first character which will be copied |
limit | offset immediately following the last character to be copied |
target | UnicodeString into which to copy characters. |
target
ICU 2.0 Implements Replaceable.
|
virtual |
Copy the characters in the range [start
, limit
) into the UnicodeString target
. Replaceable API.
start | offset of first character which will be copied |
limit | offset immediately following the last character to be copied |
target | UnicodeString into which to copy characters. |
target
ICU 2.0 Implements Replaceable.
|
virtual |
Copy the characters in the range [start
, limit
) into the UnicodeString target
. Replaceable API.
start | offset of first character which will be copied |
limit | offset immediately following the last character to be copied |
target | UnicodeString into which to copy characters. |
target
ICU 2.0 Implements Replaceable.
UnicodeString& UnicodeString::fastCopyFrom | ( | const UnicodeString & | src | ) |
Almost the same as the assignment operator. Replace the characters in this UnicodeString with the characters from srcText
.
This function works the same as the assignment operator for all strings except for ones that are readonly aliases.
Starting with ICU 2.4, the assignment operator and the copy constructor allocate a new buffer and copy the buffer contents even for readonly aliases. This function implements the old, more efficient but less safe behavior of making this string also a readonly alias to the same buffer.
The fastCopyFrom function must be used only if it is known that the lifetime of this UnicodeString does not exceed the lifetime of the aliased buffer including its contents, for example for strings from resource bundles or aliases to string constants.
src | The text containing the characters to replace. |
UnicodeString& UnicodeString::fastCopyFrom | ( | const UnicodeString & | src | ) |
Almost the same as the assignment operator. Replace the characters in this UnicodeString with the characters from srcText
.
This function works the same as the assignment operator for all strings except for ones that are readonly aliases.
Starting with ICU 2.4, the assignment operator and the copy constructor allocate a new buffer and copy the buffer contents even for readonly aliases. This function implements the old, more efficient but less safe behavior of making this string also a readonly alias to the same buffer.
The fastCopyFrom function must be used only if it is known that the lifetime of this UnicodeString does not exceed the lifetime of the aliased buffer including its contents, for example for strings from resource bundles or aliases to string constants.
src | The text containing the characters to replace. |
UnicodeString& UnicodeString::fastCopyFrom | ( | const UnicodeString & | src | ) |
Almost the same as the assignment operator. Replace the characters in this UnicodeString with the characters from srcText
.
This function works the same as the assignment operator for all strings except for ones that are readonly aliases.
Starting with ICU 2.4, the assignment operator and the copy constructor allocate a new buffer and copy the buffer contents even for readonly aliases. This function implements the old, more efficient but less safe behavior of making this string also a readonly alias to the same buffer.
The fastCopyFrom function must be used only if it is known that the lifetime of this UnicodeString does not exceed the lifetime of the aliased buffer including its contents, for example for strings from resource bundles or aliases to string constants.
src | The text containing the characters to replace. |
|
inline |
Replace all occurrences of characters in oldText with the characters in newText
oldText | the text containing the search text |
newText | the text containing the replacement text |
|
inline |
Replace all occurrences of characters in oldText with the characters in newText
oldText | the text containing the search text |
newText | the text containing the replacement text |
|
inline |
Replace all occurrences of characters in oldText with the characters in newText
oldText | the text containing the search text |
newText | the text containing the replacement text |
|
inline |
Replace all occurrences of characters in oldText with characters in newText in the range [start
, start + length
).
start | the start of the range in which replace will performed |
length | the length of the range in which replace will be performed |
oldText | the text containing the search text |
newText | the text containing the replacement text |
|
inline |
Replace all occurrences of characters in oldText with characters in newText in the range [start
, start + length
).
start | the start of the range in which replace will performed |
length | the length of the range in which replace will be performed |
oldText | the text containing the search text |
newText | the text containing the replacement text |
|
inline |
Replace all occurrences of characters in oldText with characters in newText in the range [start
, start + length
).
start | the start of the range in which replace will performed |
length | the length of the range in which replace will be performed |
oldText | the text containing the search text |
newText | the text containing the replacement text |
UnicodeString& UnicodeString::findAndReplace | ( | int32_t | start, |
int32_t | length, | ||
const UnicodeString & | oldText, | ||
int32_t | oldStart, | ||
int32_t | oldLength, | ||
const UnicodeString & | newText, | ||
int32_t | newStart, | ||
int32_t | newLength | ||
) |
Replace all occurrences of characters in oldText in the range [oldStart
, oldStart + oldLength
) with the characters in newText in the range [newStart
, newStart + newLength
) in the range [start
, start + length
).
start | the start of the range in which replace will performed |
length | the length of the range in which replace will be performed |
oldText | the text containing the search text |
oldStart | the start of the search range in oldText |
oldLength | the length of the search range in oldText |
newText | the text containing the replacement text |
newStart | the start of the replacement range in newText |
newLength | the length of the replacement range in newText |
UnicodeString& UnicodeString::findAndReplace | ( | int32_t | start, |
int32_t | length, | ||
const UnicodeString & | oldText, | ||
int32_t | oldStart, | ||
int32_t | oldLength, | ||
const UnicodeString & | newText, | ||
int32_t | newStart, | ||
int32_t | newLength | ||
) |
Replace all occurrences of characters in oldText in the range [oldStart
, oldStart + oldLength
) with the characters in newText in the range [newStart
, newStart + newLength
) in the range [start
, start + length
).
start | the start of the range in which replace will performed |
length | the length of the range in which replace will be performed |
oldText | the text containing the search text |
oldStart | the start of the search range in oldText |
oldLength | the length of the search range in oldText |
newText | the text containing the replacement text |
newStart | the start of the replacement range in newText |
newLength | the length of the replacement range in newText |
UnicodeString& UnicodeString::findAndReplace | ( | int32_t | start, |
int32_t | length, | ||
const UnicodeString & | oldText, | ||
int32_t | oldStart, | ||
int32_t | oldLength, | ||
const UnicodeString & | newText, | ||
int32_t | newStart, | ||
int32_t | newLength | ||
) |
Replace all occurrences of characters in oldText in the range [oldStart
, oldStart + oldLength
) with the characters in newText in the range [newStart
, newStart + newLength
) in the range [start
, start + length
).
start | the start of the range in which replace will performed |
length | the length of the range in which replace will be performed |
oldText | the text containing the search text |
oldStart | the start of the search range in oldText |
oldLength | the length of the search range in oldText |
newText | the text containing the replacement text |
newStart | the start of the replacement range in newText |
newLength | the length of the replacement range in newText |
UnicodeString& UnicodeString::foldCase | ( | uint32_t | options = 0 | ) |
Case-folds the characters in this string.
Case-folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.
The result may be longer or shorter than the original.
options | Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I |
UnicodeString& UnicodeString::foldCase | ( | uint32_t | options = 0 | ) |
Case-folds the characters in this string.
Case-folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.
The result may be longer or shorter than the original.
options | Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I |
UnicodeString& UnicodeString::foldCase | ( | uint32_t | options = 0 | ) |
Case-folds the characters in this string.
Case-folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.
The result may be longer or shorter than the original.
options | Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I |
|
static |
Create a UnicodeString from a UTF-32 string. Illegal input is replaced with U+FFFD. Otherwise, errors result in a bogus string. Calls u_strFromUTF32WithSub().
utf32 | UTF-32 input string. Must not be NULL. |
length | Length of the input string, or -1 if NUL-terminated. |
|
static |
Create a UnicodeString from a UTF-32 string. Illegal input is replaced with U+FFFD. Otherwise, errors result in a bogus string. Calls u_strFromUTF32WithSub().
utf32 | UTF-32 input string. Must not be NULL. |
length | Length of the input string, or -1 if NUL-terminated. |
|
static |
Create a UnicodeString from a UTF-32 string. Illegal input is replaced with U+FFFD. Otherwise, errors result in a bogus string. Calls u_strFromUTF32WithSub().
utf32 | UTF-32 input string. Must not be NULL. |
length | Length of the input string, or -1 if NUL-terminated. |
|
static |
Create a UnicodeString from a UTF-8 string. Illegal input is replaced with U+FFFD. Otherwise, errors result in a bogus string. Calls u_strFromUTF8WithSub().
utf8 | UTF-8 input string. Note that a StringPiece can be implicitly constructed from a std::string or a NUL-terminated const char * string. |
|
static |
Create a UnicodeString from a UTF-8 string. Illegal input is replaced with U+FFFD. Otherwise, errors result in a bogus string. Calls u_strFromUTF8WithSub().
utf8 | UTF-8 input string. Note that a StringPiece can be implicitly constructed from a std::string or a NUL-terminated const char * string. |
|
static |
Create a UnicodeString from a UTF-8 string. Illegal input is replaced with U+FFFD. Otherwise, errors result in a bogus string. Calls u_strFromUTF8WithSub().
utf8 | UTF-8 input string. Note that a StringPiece can be implicitly constructed from a std::string or a NUL-terminated const char * string. |
Get a read/write pointer to the internal buffer. The buffer is guaranteed to be large enough for at least minCapacity UChars, writable, and is still owned by the UnicodeString object. Calls to getBuffer(minCapacity) must not be nested, and must be matched with calls to releaseBuffer(newLength). If the string buffer was read-only or shared, then it will be reallocated and copied.
An attempted nested call will return 0, and will not further modify the state of the UnicodeString object. It also returns 0 if the string is bogus.
The actual capacity of the string buffer may be larger than minCapacity. getCapacity() returns the actual capacity. For many operations, the full capacity should be used to avoid reallocations.
While the buffer is "open" between getBuffer(minCapacity) and releaseBuffer(newLength), the following applies:
minCapacity | the minimum number of UChars that are to be available in the buffer, starting at the returned pointer; default to the current string capacity if minCapacity==-1 |
Get a read/write pointer to the internal buffer. The buffer is guaranteed to be large enough for at least minCapacity UChars, writable, and is still owned by the UnicodeString object. Calls to getBuffer(minCapacity) must not be nested, and must be matched with calls to releaseBuffer(newLength). If the string buffer was read-only or shared, then it will be reallocated and copied.
An attempted nested call will return 0, and will not further modify the state of the UnicodeString object. It also returns 0 if the string is bogus.
The actual capacity of the string buffer may be larger than minCapacity. getCapacity() returns the actual capacity. For many operations, the full capacity should be used to avoid reallocations.
While the buffer is "open" between getBuffer(minCapacity) and releaseBuffer(newLength), the following applies:
minCapacity | the minimum number of UChars that are to be available in the buffer, starting at the returned pointer; default to the current string capacity if minCapacity==-1 |
Get a read/write pointer to the internal buffer. The buffer is guaranteed to be large enough for at least minCapacity UChars, writable, and is still owned by the UnicodeString object. Calls to getBuffer(minCapacity) must not be nested, and must be matched with calls to releaseBuffer(newLength). If the string buffer was read-only or shared, then it will be reallocated and copied.
An attempted nested call will return 0, and will not further modify the state of the UnicodeString object. It also returns 0 if the string is bogus.
The actual capacity of the string buffer may be larger than minCapacity. getCapacity() returns the actual capacity. For many operations, the full capacity should be used to avoid reallocations.
While the buffer is "open" between getBuffer(minCapacity) and releaseBuffer(newLength), the following applies:
minCapacity | the minimum number of UChars that are to be available in the buffer, starting at the returned pointer; default to the current string capacity if minCapacity==-1 |
|
inline |
Get a read-only pointer to the internal buffer. This can be called at any time on a valid UnicodeString.
It returns 0 if the string is bogus, or during an "open" getBuffer(minCapacity).
It can be called as many times as desired. The pointer that it returns will remain valid until the UnicodeString object is modified, at which time the pointer is semantically invalidated and must not be used any more.
The capacity of the buffer can be determined with getCapacity(). The part after length() may or may not be initialized and valid, depending on the history of the UnicodeString object.
The buffer contents is (probably) not NUL-terminated. You can check if it is with (s.length()<s.getCapacity() && buffer[s.length()]==0)
. (See getTerminatedBuffer().)
The buffer may reside in read-only memory. Its contents must not be modified.
|
inline |
Get a read-only pointer to the internal buffer. This can be called at any time on a valid UnicodeString.
It returns 0 if the string is bogus, or during an "open" getBuffer(minCapacity).
It can be called as many times as desired. The pointer that it returns will remain valid until the UnicodeString object is modified, at which time the pointer is semantically invalidated and must not be used any more.
The capacity of the buffer can be determined with getCapacity(). The part after length() may or may not be initialized and valid, depending on the history of the UnicodeString object.
The buffer contents is (probably) not NUL-terminated. You can check if it is with (s.length()<s.getCapacity() && buffer[s.length()]==0)
. (See getTerminatedBuffer().)
The buffer may reside in read-only memory. Its contents must not be modified.
|
inline |
Get a read-only pointer to the internal buffer. This can be called at any time on a valid UnicodeString.
It returns 0 if the string is bogus, or during an "open" getBuffer(minCapacity).
It can be called as many times as desired. The pointer that it returns will remain valid until the UnicodeString object is modified, at which time the pointer is semantically invalidated and must not be used any more.
The capacity of the buffer can be determined with getCapacity(). The part after length() may or may not be initialized and valid, depending on the history of the UnicodeString object.
The buffer contents is (probably) not NUL-terminated. You can check if it is with (s.length()<s.getCapacity() && buffer[s.length()]==0)
. (See getTerminatedBuffer().)
The buffer may reside in read-only memory. Its contents must not be modified.
Return the capacity of the internal buffer of the UnicodeString object. This is useful together with the getBuffer functions. See there for details.
Return the capacity of the internal buffer of the UnicodeString object. This is useful together with the getBuffer functions. See there for details.
Return the capacity of the internal buffer of the UnicodeString object. This is useful together with the getBuffer functions. See there for details.
The change in Replaceable to use virtual getChar32At() allows UnicodeString::char32At() to be inline again (see jitterbug 709). ICU 2.4
Implements Replaceable.
The change in Replaceable to use virtual getChar32At() allows UnicodeString::char32At() to be inline again (see jitterbug 709). ICU 2.4
Implements Replaceable.
The change in Replaceable to use virtual getChar32At() allows UnicodeString::char32At() to be inline again (see jitterbug 709). ICU 2.4
Implements Replaceable.
Adjust a random-access offset so that it points behind a Unicode character. The offset that is passed in points behind any code unit of a code point, while the returned offset will point behind the last code unit of the same code point. In UTF-16, if the input offset points behind the first surrogate (i.e., to the second surrogate) of a surrogate pair, then the returned offset will point behind the second surrogate (i.e., to the first surrogate).
offset | a valid offset after any code unit of a code point of the text |
Adjust a random-access offset so that it points behind a Unicode character. The offset that is passed in points behind any code unit of a code point, while the returned offset will point behind the last code unit of the same code point. In UTF-16, if the input offset points behind the first surrogate (i.e., to the second surrogate) of a surrogate pair, then the returned offset will point behind the second surrogate (i.e., to the first surrogate).
offset | a valid offset after any code unit of a code point of the text |
Adjust a random-access offset so that it points behind a Unicode character. The offset that is passed in points behind any code unit of a code point, while the returned offset will point behind the last code unit of the same code point. In UTF-16, if the input offset points behind the first surrogate (i.e., to the second surrogate) of a surrogate pair, then the returned offset will point behind the second surrogate (i.e., to the first surrogate).
offset | a valid offset after any code unit of a code point of the text |
Adjust a random-access offset so that it points to the beginning of a Unicode character. The offset that is passed in points to any code unit of a code point, while the returned offset will point to the first code unit of the same code point. In UTF-16, if the input offset points to a second surrogate of a surrogate pair, then the returned offset will point to the first surrogate.
offset | a valid offset into one code point of the text |
Adjust a random-access offset so that it points to the beginning of a Unicode character. The offset that is passed in points to any code unit of a code point, while the returned offset will point to the first code unit of the same code point. In UTF-16, if the input offset points to a second surrogate of a surrogate pair, then the returned offset will point to the first surrogate.
offset | a valid offset into one code point of the text |
Adjust a random-access offset so that it points to the beginning of a Unicode character. The offset that is passed in points to any code unit of a code point, while the returned offset will point to the first code unit of the same code point. In UTF-16, if the input offset points to a second surrogate of a surrogate pair, then the returned offset will point to the first surrogate.
offset | a valid offset into one code point of the text |
The change in Replaceable to use virtual getCharAt() allows UnicodeString::charAt() to be inline again (see jitterbug 709). ICU 2.4
Implements Replaceable.
The change in Replaceable to use virtual getCharAt() allows UnicodeString::charAt() to be inline again (see jitterbug 709). ICU 2.4
Implements Replaceable.
The change in Replaceable to use virtual getCharAt() allows UnicodeString::charAt() to be inline again (see jitterbug 709). ICU 2.4
Implements Replaceable.
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
Implement Replaceable::getLength() (see jitterbug 1027). ICU 2.4
Implements Replaceable.
|
protectedvirtual |
Implement Replaceable::getLength() (see jitterbug 1027). ICU 2.4
Implements Replaceable.
|
protectedvirtual |
Implement Replaceable::getLength() (see jitterbug 1027). ICU 2.4
Implements Replaceable.
ICU "poor man's RTTI", returns a UClassID for this class.
ICU 2.2
ICU "poor man's RTTI", returns a UClassID for this class.
ICU 2.2
ICU "poor man's RTTI", returns a UClassID for this class.
ICU 2.2
const UChar* UnicodeString::getTerminatedBuffer | ( | ) |
Get a read-only pointer to the internal buffer, making sure that it is NUL-terminated. This can be called at any time on a valid UnicodeString.
It returns 0 if the string is bogus, or during an "open" getBuffer(minCapacity), or if the buffer cannot be NUL-terminated (because memory allocation failed).
It can be called as many times as desired. The pointer that it returns will remain valid until the UnicodeString object is modified, at which time the pointer is semantically invalidated and must not be used any more.
The capacity of the buffer can be determined with getCapacity(). The part after length()+1 may or may not be initialized and valid, depending on the history of the UnicodeString object.
The buffer contents is guaranteed to be NUL-terminated. getTerminatedBuffer() may reallocate the buffer if a terminating NUL is written. For this reason, this function is not const, unlike getBuffer(). Note that a UnicodeString may also contain NUL characters as part of its contents.
The buffer may reside in read-only memory. Its contents must not be modified.
const UChar* UnicodeString::getTerminatedBuffer | ( | ) |
Get a read-only pointer to the internal buffer, making sure that it is NUL-terminated. This can be called at any time on a valid UnicodeString.
It returns 0 if the string is bogus, or during an "open" getBuffer(minCapacity), or if the buffer cannot be NUL-terminated (because memory allocation failed).
It can be called as many times as desired. The pointer that it returns will remain valid until the UnicodeString object is modified, at which time the pointer is semantically invalidated and must not be used any more.
The capacity of the buffer can be determined with getCapacity(). The part after length()+1 may or may not be initialized and valid, depending on the history of the UnicodeString object.
The buffer contents is guaranteed to be NUL-terminated. getTerminatedBuffer() may reallocate the buffer if a terminating NUL is written. For this reason, this function is not const, unlike getBuffer(). Note that a UnicodeString may also contain NUL characters as part of its contents.
The buffer may reside in read-only memory. Its contents must not be modified.
const UChar* UnicodeString::getTerminatedBuffer | ( | ) |
Get a read-only pointer to the internal buffer, making sure that it is NUL-terminated. This can be called at any time on a valid UnicodeString.
It returns 0 if the string is bogus, or during an "open" getBuffer(minCapacity), or if the buffer cannot be NUL-terminated (because memory allocation failed).
It can be called as many times as desired. The pointer that it returns will remain valid until the UnicodeString object is modified, at which time the pointer is semantically invalidated and must not be used any more.
The capacity of the buffer can be determined with getCapacity(). The part after length()+1 may or may not be initialized and valid, depending on the history of the UnicodeString object.
The buffer contents is guaranteed to be NUL-terminated. getTerminatedBuffer() may reallocate the buffer if a terminating NUL is written. For this reason, this function is not const, unlike getBuffer(). Note that a UnicodeString may also contain NUL characters as part of its contents.
The buffer may reside in read-only memory. Its contents must not be modified.
|
virtual |
Replace a substring of this object with the given text.
start | the beginning index, inclusive; 0 <= start <= limit . |
limit | the ending index, exclusive; start <= limit <= length() . |
text | the text to replace characters start to limit - 1 ICU 2.0 |
Implements Replaceable.
|
virtual |
Replace a substring of this object with the given text.
start | the beginning index, inclusive; 0 <= start <= limit . |
limit | the ending index, exclusive; start <= limit <= length() . |
text | the text to replace characters start to limit - 1 ICU 2.0 |
Implements Replaceable.
|
virtual |
Replace a substring of this object with the given text.
start | the beginning index, inclusive; 0 <= start <= limit . |
limit | the ending index, exclusive; start <= limit <= length() . |
text | the text to replace characters start to limit - 1 ICU 2.0 |
Implements Replaceable.
Generate a hash code for this object.
Generate a hash code for this object.
Generate a hash code for this object.
|
virtual |
|
virtual |
|
virtual |
Check if the length UChar code units of the string contain more Unicode code points than a certain number. This is more efficient than counting all code points in this part of the string and comparing that number with a threshold. This function may not need to scan the string at all if the length falls within a certain range, and never needs to count more than 'number+1' code points. Logically equivalent to (countChar32(start, length)>number). A Unicode code point may occupy either one or two UChar code units.
start | the index of the first code unit to check (0 for the entire string) |
length | the number of UChar code units to check (use INT32_MAX for the entire string; remember that start/length values are pinned) |
number | The number of code points in the (sub)string is compared against the 'number' parameter. |
Check if the length UChar code units of the string contain more Unicode code points than a certain number. This is more efficient than counting all code points in this part of the string and comparing that number with a threshold. This function may not need to scan the string at all if the length falls within a certain range, and never needs to count more than 'number+1' code points. Logically equivalent to (countChar32(start, length)>number). A Unicode code point may occupy either one or two UChar code units.
start | the index of the first code unit to check (0 for the entire string) |
length | the number of UChar code units to check (use INT32_MAX for the entire string; remember that start/length values are pinned) |
number | The number of code points in the (sub)string is compared against the 'number' parameter. |
Check if the length UChar code units of the string contain more Unicode code points than a certain number. This is more efficient than counting all code points in this part of the string and comparing that number with a threshold. This function may not need to scan the string at all if the length falls within a certain range, and never needs to count more than 'number+1' code points. Logically equivalent to (countChar32(start, length)>number). A Unicode code point may occupy either one or two UChar code units.
start | the index of the first code unit to check (0 for the entire string) |
length | the number of UChar code units to check (use INT32_MAX for the entire string; remember that start/length values are pinned) |
number | The number of code points in the (sub)string is compared against the 'number' parameter. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in text
, using bitwise comparison.
text | The text to search for. |
start | The offset at which searching will start. |
length | The number of characters to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in text
, using bitwise comparison.
text | The text to search for. |
start | The offset at which searching will start. |
length | The number of characters to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in text
, using bitwise comparison.
text | The text to search for. |
start | The offset at which searching will start. |
length | The number of characters to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcText
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcText | The text to search for. |
srcStart | the offset into srcText at which to start matching |
srcLength | the number of characters in srcText to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcText
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcText | The text to search for. |
srcStart | the offset into srcText at which to start matching |
srcLength | the number of characters in srcText to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcText
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcText | The text to search for. |
srcStart | the offset into srcText at which to start matching |
srcLength | the number of characters in srcText to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence of the characters in srcChars
starting at offset start
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence of the characters in srcChars
starting at offset start
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence of the characters in srcChars
starting at offset start
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcChars
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars |
start | The offset at which searching will start. |
length | The number of characters to search |
srcChars
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcChars
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars |
start | The offset at which searching will start. |
length | The number of characters to search |
srcChars
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcChars
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars |
start | The offset at which searching will start. |
length | The number of characters to search |
srcChars
, or -1 if not found. ICU 2.0 int32_t UnicodeString::indexOf | ( | const UChar * | srcChars, |
int32_t | srcStart, | ||
int32_t | srcLength, | ||
int32_t | start, | ||
int32_t | length | ||
) | const |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcChars
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcChars | The text to search for. |
srcStart | the offset into srcChars at which to start matching |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0 int32_t UnicodeString::indexOf | ( | const UChar * | srcChars, |
int32_t | srcStart, | ||
int32_t | srcLength, | ||
int32_t | start, | ||
int32_t | length | ||
) | const |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcChars
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcChars | The text to search for. |
srcStart | the offset into srcChars at which to start matching |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0 int32_t UnicodeString::indexOf | ( | const UChar * | srcChars, |
int32_t | srcStart, | ||
int32_t | srcLength, | ||
int32_t | start, | ||
int32_t | length | ||
) | const |
Locate in this the first occurrence in the range [start
, start + length
) of the characters in srcChars
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcChars | The text to search for. |
srcStart | the offset into srcChars at which to start matching |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0 Locate in this the first occurrence of the BMP code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code unit to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the first occurrence of the BMP code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code unit to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the first occurrence of the BMP code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code unit to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the first occurrence of the code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code point to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the first occurrence of the code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code point to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the first occurrence of the code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code point to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0
|
inline |
Insert the characters in srcText
in the range [srcStart
, srcStart + srcLength
) into the UnicodeString object at offset start
. srcText
is not modified.
start | the offset where the insertion begins |
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the insert string |
|
inline |
Insert the characters in srcText
in the range [srcStart
, srcStart + srcLength
) into the UnicodeString object at offset start
. srcText
is not modified.
start | the offset where the insertion begins |
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the insert string |
|
inline |
Insert the characters in srcText
in the range [srcStart
, srcStart + srcLength
) into the UnicodeString object at offset start
. srcText
is not modified.
start | the offset where the insertion begins |
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the insert string |
|
inline |
Insert the characters in srcText
into the UnicodeString object at offset start
. srcText
is not modified.
start | the offset where the insertion begins |
srcText | the source for the new characters |
|
inline |
Insert the characters in srcText
into the UnicodeString object at offset start
. srcText
is not modified.
start | the offset where the insertion begins |
srcText | the source for the new characters |
|
inline |
Insert the characters in srcText
into the UnicodeString object at offset start
. srcText
is not modified.
start | the offset where the insertion begins |
srcText | the source for the new characters |
|
inline |
Insert the characters in srcChars
in the range [srcStart
, srcStart + srcLength
) into the UnicodeString object at offset start
. srcChars
is not modified.
start | the offset at which the insertion begins |
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the insert string |
|
inline |
Insert the characters in srcChars
in the range [srcStart
, srcStart + srcLength
) into the UnicodeString object at offset start
. srcChars
is not modified.
start | the offset at which the insertion begins |
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the insert string |
|
inline |
Insert the characters in srcChars
in the range [srcStart
, srcStart + srcLength
) into the UnicodeString object at offset start
. srcChars
is not modified.
start | the offset at which the insertion begins |
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the insert string |
|
inline |
Insert the characters in srcChars
into the UnicodeString object at offset start
. srcChars
is not modified.
start | the offset where the insertion begins |
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars. |
|
inline |
Insert the characters in srcChars
into the UnicodeString object at offset start
. srcChars
is not modified.
start | the offset where the insertion begins |
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars. |
|
inline |
Insert the characters in srcChars
into the UnicodeString object at offset start
. srcChars
is not modified.
start | the offset where the insertion begins |
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars. |
|
inline |
Insert the code unit srcChar
into the UnicodeString object at offset start
.
start | the offset at which the insertion occurs |
srcChar | the code unit to insert |
|
inline |
Insert the code unit srcChar
into the UnicodeString object at offset start
.
start | the offset at which the insertion occurs |
srcChar | the code unit to insert |
|
inline |
Insert the code unit srcChar
into the UnicodeString object at offset start
.
start | the offset at which the insertion occurs |
srcChar | the code unit to insert |
|
inline |
Insert the code point srcChar
into the UnicodeString object at offset start
.
start | the offset at which the insertion occurs |
srcChar | the code point to insert |
|
inline |
Insert the code point srcChar
into the UnicodeString object at offset start
.
start | the offset at which the insertion occurs |
srcChar | the code point to insert |
|
inline |
Insert the code point srcChar
into the UnicodeString object at offset start
.
start | the offset at which the insertion occurs |
srcChar | the code point to insert |
Determine if this object contains a valid string. A bogus string has no value. It is different from an empty string, although in both cases isEmpty() returns TRUE and length() returns 0. setToBogus() and isBogus() can be used to indicate that no string value is available. For a bogus string, getBuffer() and getTerminatedBuffer() return NULL, and length() returns 0.
Determine if this object contains a valid string. A bogus string has no value. It is different from an empty string, although in both cases isEmpty() returns TRUE and length() returns 0. setToBogus() and isBogus() can be used to indicate that no string value is available. For a bogus string, getBuffer() and getTerminatedBuffer() return NULL, and length() returns 0.
Determine if this object contains a valid string. A bogus string has no value. It is different from an empty string, although in both cases isEmpty() returns TRUE and length() returns 0. setToBogus() and isBogus() can be used to indicate that no string value is available. For a bogus string, getBuffer() and getTerminatedBuffer() return NULL, and length() returns 0.
Determine if this string is empty.
Determine if this string is empty.
Determine if this string is empty.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in text
, using bitwise comparison.
text | The text to search for. |
start | The offset at which searching will start. |
length | The number of characters to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in text
, using bitwise comparison.
text | The text to search for. |
start | The offset at which searching will start. |
length | The number of characters to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in text
, using bitwise comparison.
text | The text to search for. |
start | The offset at which searching will start. |
length | The number of characters to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcText
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcText | The text to search for. |
srcStart | the offset into srcText at which to start matching |
srcLength | the number of characters in srcText to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcText
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcText | The text to search for. |
srcStart | the offset into srcText at which to start matching |
srcLength | the number of characters in srcText to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcText
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcText | The text to search for. |
srcStart | the offset into srcText at which to start matching |
srcLength | the number of characters in srcText to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence of the characters in srcChars
starting at offset start
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence of the characters in srcChars
starting at offset start
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence of the characters in srcChars
starting at offset start
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
text
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcChars
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars |
start | The offset at which searching will start. |
length | The number of characters to search |
srcChars
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcChars
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars |
start | The offset at which searching will start. |
length | The number of characters to search |
srcChars
, or -1 if not found. ICU 2.0
|
inline |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcChars
, using bitwise comparison.
srcChars | The text to search for. |
srcLength | the number of characters in srcChars |
start | The offset at which searching will start. |
length | The number of characters to search |
srcChars
, or -1 if not found. ICU 2.0 int32_t UnicodeString::lastIndexOf | ( | const UChar * | srcChars, |
int32_t | srcStart, | ||
int32_t | srcLength, | ||
int32_t | start, | ||
int32_t | length | ||
) | const |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcChars
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcChars | The text to search for. |
srcStart | the offset into srcChars at which to start matching |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0 int32_t UnicodeString::lastIndexOf | ( | const UChar * | srcChars, |
int32_t | srcStart, | ||
int32_t | srcLength, | ||
int32_t | start, | ||
int32_t | length | ||
) | const |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcChars
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcChars | The text to search for. |
srcStart | the offset into srcChars at which to start matching |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0 int32_t UnicodeString::lastIndexOf | ( | const UChar * | srcChars, |
int32_t | srcStart, | ||
int32_t | srcLength, | ||
int32_t | start, | ||
int32_t | length | ||
) | const |
Locate in this the last occurrence in the range [start
, start + length
) of the characters in srcChars
in the range [srcStart
, srcStart + srcLength
), using bitwise comparison.
srcChars | The text to search for. |
srcStart | the offset into srcChars at which to start matching |
srcLength | the number of characters in srcChars to match |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
text
, or -1 if not found. ICU 2.0 Locate in this the last occurrence of the BMP code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code unit to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the last occurrence of the BMP code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code unit to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the last occurrence of the BMP code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code unit to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the last occurrence of the code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code point to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the last occurrence of the code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code point to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Locate in this the last occurrence of the code point c
in the range [start
, start + length
), using bitwise comparison.
c | The code point to search for. |
start | the offset into this at which to start matching |
length | the number of characters in this to search |
c
, or -1 if not found. ICU 2.0 Return the length of the UnicodeString object. The length is the number of UChar code units are in the UnicodeString. If you want the number of code points, please use countChar32().
Return the length of the UnicodeString object. The length is the number of UChar code units are in the UnicodeString. If you want the number of code points, please use countChar32().
Return the length of the UnicodeString object. The length is the number of UChar code units are in the UnicodeString. If you want the number of code points, please use countChar32().
Move the code unit index along the string by delta code points. Interpret the input index as a code unit-based offset into the string, move the index forward or backward by delta code points, and return the resulting index. The input index should point to the first code unit of a code point, if there is more than one.
Both input and output indexes are code unit-based as for all string indexes/offsets in ICU (and other libraries, like MBCS char*). If delta<0 then the index is moved backward (toward the start of the string). If delta>0 then the index is moved forward (toward the end of the string).
This behaves like CharacterIterator::move32(delta, kCurrent).
Behavior for out-of-bounds indexes: moveIndex32
pins the input index to 0..length(), i.e., if the input index<0 then it is pinned to 0; if it is index>length() then it is pinned to length(). Afterwards, the index is moved by delta
code points forward or backward, but no further backward than to 0 and no further forward than to length(). The resulting index return value will be in between 0 and length(), inclusively.
Examples:
// s has code points 'a' U+10000 'b' U+10ffff U+2029 UnicodeString s=UNICODE_STRING("a\\U00010000b\\U0010ffff\\u2029", 31).unescape();
// initial index: position of U+10000 int32_t index=1;
// the following examples will all result in index==4, position of U+10ffff
// skip 2 code points from some position in the string index=s.moveIndex32(index, 2); // skips U+10000 and 'b'
// go to the 3rd code point from the start of s (0-based) index=s.moveIndex32(0, 3); // skips 'a', U+10000, and 'b'
// go to the next-to-last code point of s index=s.moveIndex32(s.length(), -2); // backward-skips U+2029 and U+10ffff
index | input code unit index |
delta | (signed) code point count to move the index forward or backward in the string |
Move the code unit index along the string by delta code points. Interpret the input index as a code unit-based offset into the string, move the index forward or backward by delta code points, and return the resulting index. The input index should point to the first code unit of a code point, if there is more than one.
Both input and output indexes are code unit-based as for all string indexes/offsets in ICU (and other libraries, like MBCS char*). If delta<0 then the index is moved backward (toward the start of the string). If delta>0 then the index is moved forward (toward the end of the string).
This behaves like CharacterIterator::move32(delta, kCurrent).
Behavior for out-of-bounds indexes: moveIndex32
pins the input index to 0..length(), i.e., if the input index<0 then it is pinned to 0; if it is index>length() then it is pinned to length(). Afterwards, the index is moved by delta
code points forward or backward, but no further backward than to 0 and no further forward than to length(). The resulting index return value will be in between 0 and length(), inclusively.
Examples:
// s has code points 'a' U+10000 'b' U+10ffff U+2029 UnicodeString s=UNICODE_STRING("a\\U00010000b\\U0010ffff\\u2029", 31).unescape();
// initial index: position of U+10000 int32_t index=1;
// the following examples will all result in index==4, position of U+10ffff
// skip 2 code points from some position in the string index=s.moveIndex32(index, 2); // skips U+10000 and 'b'
// go to the 3rd code point from the start of s (0-based) index=s.moveIndex32(0, 3); // skips 'a', U+10000, and 'b'
// go to the next-to-last code point of s index=s.moveIndex32(s.length(), -2); // backward-skips U+2029 and U+10ffff
index | input code unit index |
delta | (signed) code point count to move the index forward or backward in the string |
Move the code unit index along the string by delta code points. Interpret the input index as a code unit-based offset into the string, move the index forward or backward by delta code points, and return the resulting index. The input index should point to the first code unit of a code point, if there is more than one.
Both input and output indexes are code unit-based as for all string indexes/offsets in ICU (and other libraries, like MBCS char*). If delta<0 then the index is moved backward (toward the start of the string). If delta>0 then the index is moved forward (toward the end of the string).
This behaves like CharacterIterator::move32(delta, kCurrent).
Behavior for out-of-bounds indexes: moveIndex32
pins the input index to 0..length(), i.e., if the input index<0 then it is pinned to 0; if it is index>length() then it is pinned to length(). Afterwards, the index is moved by delta
code points forward or backward, but no further backward than to 0 and no further forward than to length(). The resulting index return value will be in between 0 and length(), inclusively.
Examples:
// s has code points 'a' U+10000 'b' U+10ffff U+2029 UnicodeString s=UNICODE_STRING("a\\U00010000b\\U0010ffff\\u2029", 31).unescape();
// initial index: position of U+10000 int32_t index=1;
// the following examples will all result in index==4, position of U+10ffff
// skip 2 code points from some position in the string index=s.moveIndex32(index, 2); // skips U+10000 and 'b'
// go to the 3rd code point from the start of s (0-based) index=s.moveIndex32(0, 3); // skips 'a', U+10000, and 'b'
// go to the next-to-last code point of s index=s.moveIndex32(s.length(), -2); // backward-skips U+2029 and U+10ffff
index | input code unit index |
delta | (signed) code point count to move the index forward or backward in the string |
|
inline |
Inequality operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
contains the same characters as this one, TRUE otherwise. ICU 2.0
|
inline |
Inequality operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
contains the same characters as this one, TRUE otherwise. ICU 2.0
|
inline |
Inequality operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
contains the same characters as this one, TRUE otherwise. ICU 2.0
|
inline |
Append operator. Append the code unit ch
to the UnicodeString object.
ch | the code unit to be appended |
|
inline |
Append operator. Append the code unit ch
to the UnicodeString object.
ch | the code unit to be appended |
|
inline |
Append operator. Append the code unit ch
to the UnicodeString object.
ch | the code unit to be appended |
|
inline |
Append operator. Append the code point ch
to the UnicodeString object.
ch | the code point to be appended |
|
inline |
Append operator. Append the code point ch
to the UnicodeString object.
ch | the code point to be appended |
|
inline |
Append operator. Append the code point ch
to the UnicodeString object.
ch | the code point to be appended |
|
inline |
Append operator. Append the characters in srcText
to the UnicodeString object. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Append operator. Append the characters in srcText
to the UnicodeString object. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Append operator. Append the characters in srcText
to the UnicodeString object. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Less than operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Less than operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Less than operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Less than or equal operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Less than or equal operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Less than or equal operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0 UnicodeString& UnicodeString::operator= | ( | const UnicodeString & | srcText | ) |
Assignment operator. Replace the characters in this UnicodeString with the characters from srcText
.
srcText | The text containing the characters to replace |
UnicodeString& UnicodeString::operator= | ( | const UnicodeString & | srcText | ) |
Assignment operator. Replace the characters in this UnicodeString with the characters from srcText
.
srcText | The text containing the characters to replace |
UnicodeString& UnicodeString::operator= | ( | const UnicodeString & | srcText | ) |
Assignment operator. Replace the characters in this UnicodeString with the characters from srcText
.
srcText | The text containing the characters to replace |
|
inline |
Assignment operator. Replace the characters in this UnicodeString with the code unit ch
.
ch | the code unit to replace |
|
inline |
Assignment operator. Replace the characters in this UnicodeString with the code unit ch
.
ch | the code unit to replace |
|
inline |
Assignment operator. Replace the characters in this UnicodeString with the code unit ch
.
ch | the code unit to replace |
|
inline |
Assignment operator. Replace the characters in this UnicodeString with the code point ch
.
ch | the code point to replace |
|
inline |
Assignment operator. Replace the characters in this UnicodeString with the code point ch
.
ch | the code point to replace |
|
inline |
Assignment operator. Replace the characters in this UnicodeString with the code point ch
.
ch | the code point to replace |
|
inline |
Equality operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
contains the same characters as this one, FALSE otherwise. ICU 2.0
|
inline |
Equality operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
contains the same characters as this one, FALSE otherwise. ICU 2.0
|
inline |
Equality operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
contains the same characters as this one, FALSE otherwise. ICU 2.0
|
inline |
Greater than operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Greater than operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Greater than operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Greater than or equal operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Greater than or equal operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0
|
inline |
Greater than or equal operator. Performs only bitwise comparison.
text | The UnicodeString to compare to this one. |
text
, FALSE otherwise ICU 2.0 Return the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text |
offset
ICU 2.0 Return the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text |
offset
ICU 2.0 Return the code unit at offset offset
. If the offset is not valid (0..length()-1) then U+ffff is returned.
offset | a valid offset into the text |
offset
ICU 2.0 Pad the start of this UnicodeString with the character padChar
. If the length of this UnicodeString is less than targetLength, length() - targetLength copies of padChar will be added to the beginning of this UnicodeString.
targetLength | the desired length of the string |
padChar | the character to use for padding. Defaults to space (U+0020) |
Pad the start of this UnicodeString with the character padChar
. If the length of this UnicodeString is less than targetLength, length() - targetLength copies of padChar will be added to the beginning of this UnicodeString.
targetLength | the desired length of the string |
padChar | the character to use for padding. Defaults to space (U+0020) |
Pad the start of this UnicodeString with the character padChar
. If the length of this UnicodeString is less than targetLength, length() - targetLength copies of padChar will be added to the beginning of this UnicodeString.
targetLength | the desired length of the string |
padChar | the character to use for padding. Defaults to space (U+0020) |
Pad the end of this UnicodeString with the character padChar
. If the length of this UnicodeString is less than targetLength, length() - targetLength copies of padChar will be added to the end of this UnicodeString.
targetLength | the desired length of the string |
padChar | the character to use for padding. Defaults to space (U+0020) |
Pad the end of this UnicodeString with the character padChar
. If the length of this UnicodeString is less than targetLength, length() - targetLength copies of padChar will be added to the end of this UnicodeString.
targetLength | the desired length of the string |
padChar | the character to use for padding. Defaults to space (U+0020) |
Pad the end of this UnicodeString with the character padChar
. If the length of this UnicodeString is less than targetLength, length() - targetLength copies of padChar will be added to the end of this UnicodeString.
targetLength | the desired length of the string |
padChar | the character to use for padding. Defaults to space (U+0020) |
Release a read/write buffer on a UnicodeString object with an "open" getBuffer(minCapacity). This function must be called in a matched pair with getBuffer(minCapacity). releaseBuffer(newLength) must be called if and only if a getBuffer(minCapacity) is "open".
It will set the string length to newLength, at most to the current capacity. If newLength==-1 then it will set the length according to the first NUL in the buffer, or to the capacity if there is no NUL.
After calling releaseBuffer(newLength) the UnicodeString is back to normal operation.
newLength | the new length of the UnicodeString object; defaults to the current capacity if newLength is greater than that; if newLength==-1, it defaults to u_strlen(buffer) but not more than the current capacity of the string |
Release a read/write buffer on a UnicodeString object with an "open" getBuffer(minCapacity). This function must be called in a matched pair with getBuffer(minCapacity). releaseBuffer(newLength) must be called if and only if a getBuffer(minCapacity) is "open".
It will set the string length to newLength, at most to the current capacity. If newLength==-1 then it will set the length according to the first NUL in the buffer, or to the capacity if there is no NUL.
After calling releaseBuffer(newLength) the UnicodeString is back to normal operation.
newLength | the new length of the UnicodeString object; defaults to the current capacity if newLength is greater than that; if newLength==-1, it defaults to u_strlen(buffer) but not more than the current capacity of the string |
Release a read/write buffer on a UnicodeString object with an "open" getBuffer(minCapacity). This function must be called in a matched pair with getBuffer(minCapacity). releaseBuffer(newLength) must be called if and only if a getBuffer(minCapacity) is "open".
It will set the string length to newLength, at most to the current capacity. If newLength==-1 then it will set the length according to the first NUL in the buffer, or to the capacity if there is no NUL.
After calling releaseBuffer(newLength) the UnicodeString is back to normal operation.
newLength | the new length of the UnicodeString object; defaults to the current capacity if newLength is greater than that; if newLength==-1, it defaults to u_strlen(buffer) but not more than the current capacity of the string |
|
inline |
Remove all characters from the UnicodeString object.
|
inline |
Remove all characters from the UnicodeString object.
|
inline |
Remove all characters from the UnicodeString object.
|
inline |
Remove the characters in the range [start
, start + length
) from the UnicodeString object.
start | the offset of the first character to remove |
length | the number of characters to remove |
|
inline |
Remove the characters in the range [start
, start + length
) from the UnicodeString object.
start | the offset of the first character to remove |
length | the number of characters to remove |
|
inline |
Remove the characters in the range [start
, start + length
) from the UnicodeString object.
start | the offset of the first character to remove |
length | the number of characters to remove |
|
inline |
Remove the characters in the range [start
, limit
) from the UnicodeString object.
start | the offset of the first character to remove |
limit | the offset immediately following the range to remove |
|
inline |
Remove the characters in the range [start
, limit
) from the UnicodeString object.
start | the offset of the first character to remove |
limit | the offset immediately following the range to remove |
|
inline |
Remove the characters in the range [start
, limit
) from the UnicodeString object.
start | the offset of the first character to remove |
limit | the offset immediately following the range to remove |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
const UnicodeString & | srcText, | ||
int32_t | srcStart, | ||
int32_t | srcLength | ||
) |
Replace the characters in the range [start
, start + length
) with the characters in srcText
in the range [srcStart
, srcStart + srcLength
). srcText
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the replace string |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
const UnicodeString & | srcText, | ||
int32_t | srcStart, | ||
int32_t | srcLength | ||
) |
Replace the characters in the range [start
, start + length
) with the characters in srcText
in the range [srcStart
, srcStart + srcLength
). srcText
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the replace string |
|
inline |
Replace the characters in the range [start
, start + length
) with the characters in srcText
in the range [srcStart
, srcStart + srcLength
). srcText
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the replace string |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
const UnicodeString & | srcText | ||
) |
Replace the characters in the range [start
, start + length
) with the characters in srcText
. srcText
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcText | the source for the new characters |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
const UnicodeString & | srcText | ||
) |
Replace the characters in the range [start
, start + length
) with the characters in srcText
. srcText
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcText | the source for the new characters |
|
inline |
Replace the characters in the range [start
, start + length
) with the characters in srcText
. srcText
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcText | the source for the new characters |
|
inline |
Replace the characters in the range [start
, start + length
) with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
). srcChars
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the replace string |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
const UChar * | srcChars, | ||
int32_t | srcStart, | ||
int32_t | srcLength | ||
) |
Replace the characters in the range [start
, start + length
) with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
). srcChars
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the replace string |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
const UChar * | srcChars, | ||
int32_t | srcStart, | ||
int32_t | srcLength | ||
) |
Replace the characters in the range [start
, start + length
) with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
). srcChars
is not modified.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChars | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLength | the number of characters in srcChars in the replace string |
|
inline |
Replace the characters in the range [start
, start + length
) with the characters in srcChars
. srcChars
is not modified.
start | the offset at which the replace operation begins |
length | number of characters to replace. The character at start + length is not modified. |
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars |
|
inline |
Replace the characters in the range [start
, start + length
) with the characters in srcChars
. srcChars
is not modified.
start | the offset at which the replace operation begins |
length | number of characters to replace. The character at start + length is not modified. |
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars |
|
inline |
Replace the characters in the range [start
, start + length
) with the characters in srcChars
. srcChars
is not modified.
start | the offset at which the replace operation begins |
length | number of characters to replace. The character at start + length is not modified. |
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars |
|
inline |
Replace the characters in the range [start
, start + length
) with the code unit srcChar
.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChar | the new code unit |
|
inline |
Replace the characters in the range [start
, start + length
) with the code unit srcChar
.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChar | the new code unit |
|
inline |
Replace the characters in the range [start
, start + length
) with the code unit srcChar
.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChar | the new code unit |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
UChar32 | srcChar | ||
) |
Replace the characters in the range [start
, start + length
) with the code point srcChar
.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChar | the new code point |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
UChar32 | srcChar | ||
) |
Replace the characters in the range [start
, start + length
) with the code point srcChar
.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChar | the new code point |
UnicodeString& UnicodeString::replace | ( | int32_t | start, |
int32_t | length, | ||
UChar32 | srcChar | ||
) |
Replace the characters in the range [start
, start + length
) with the code point srcChar
.
start | the offset at which the replace operation begins |
length | the number of characters to replace. The character at start + length is not modified. |
srcChar | the new code point |
|
inline |
Replace the characters in the range [start
, limit
) with the characters in srcText
. srcText
is not modified.
start | the offset at which the replace operation begins |
limit | the offset immediately following the replace range |
srcText | the source for the new characters |
|
inline |
Replace the characters in the range [start
, limit
) with the characters in srcText
. srcText
is not modified.
start | the offset at which the replace operation begins |
limit | the offset immediately following the replace range |
srcText | the source for the new characters |
|
inline |
Replace the characters in the range [start
, limit
) with the characters in srcText
. srcText
is not modified.
start | the offset at which the replace operation begins |
limit | the offset immediately following the replace range |
srcText | the source for the new characters |
|
inline |
Replace the characters in the range [start
, limit
) with the characters in srcText
in the range [srcStart
, srcLimit
). srcText
is not modified.
start | the offset at which the replace operation begins |
limit | the offset immediately following the replace range |
srcText | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLimit | the offset immediately following the range to copy in srcText |
|
inline |
Replace the characters in the range [start
, limit
) with the characters in srcText
in the range [srcStart
, srcLimit
). srcText
is not modified.
start | the offset at which the replace operation begins |
limit | the offset immediately following the replace range |
srcText | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLimit | the offset immediately following the range to copy in srcText |
|
inline |
Replace the characters in the range [start
, limit
) with the characters in srcText
in the range [srcStart
, srcLimit
). srcText
is not modified.
start | the offset at which the replace operation begins |
limit | the offset immediately following the replace range |
srcText | the source for the new characters |
srcStart | the offset into srcChars where new characters will be obtained |
srcLimit | the offset immediately following the range to copy in srcText |
|
inline |
Retain only the characters in the range [start
, limit
) from the UnicodeString object. Removes characters before start
and at and after limit
.
start | the offset of the first character to retain |
limit | the offset immediately following the range to retain |
|
inline |
Retain only the characters in the range [start
, limit
) from the UnicodeString object. Removes characters before start
and at and after limit
.
start | the offset of the first character to retain |
limit | the offset immediately following the range to retain |
|
inline |
Retain only the characters in the range [start
, limit
) from the UnicodeString object. Removes characters before start
and at and after limit
.
start | the offset of the first character to retain |
limit | the offset immediately following the range to retain |
|
inline |
Reverse this UnicodeString in place.
|
inline |
Reverse this UnicodeString in place.
|
inline |
Reverse this UnicodeString in place.
|
inline |
Reverse the range [start
, start + length
) in this UnicodeString.
start | the start of the range to reverse |
length | the number of characters to to reverse |
|
inline |
Reverse the range [start
, start + length
) in this UnicodeString.
start | the start of the range to reverse |
length | the number of characters to to reverse |
|
inline |
Reverse the range [start
, start + length
) in this UnicodeString.
start | the start of the range to reverse |
length | the number of characters to to reverse |
UnicodeString& UnicodeString::setCharAt | ( | int32_t | offset, |
UChar | ch | ||
) |
UnicodeString& UnicodeString::setCharAt | ( | int32_t | offset, |
UChar | ch | ||
) |
UnicodeString& UnicodeString::setCharAt | ( | int32_t | offset, |
UChar | ch | ||
) |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
in the range [srcStart
, srcText.length()
). srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
in the range [srcStart
, srcText.length()
). srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
in the range [srcStart
, srcText.length()
). srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
in the range [srcStart
, srcStart + srcLength
). srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the replace string. |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
in the range [srcStart
, srcStart + srcLength
). srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the replace string. |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
in the range [srcStart
, srcStart + srcLength
). srcText
is not modified.
srcText | the source for the new characters |
srcStart | the offset into srcText where new characters will be obtained |
srcLength | the number of characters in srcText in the replace string. |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Set the text in the UnicodeString object to the characters in srcText
. srcText
is not modified.
srcText | the source for the new characters |
|
inline |
Set the characters in the UnicodeString object to the characters in srcChars
. srcChars
is not modified.
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars. |
|
inline |
Set the characters in the UnicodeString object to the characters in srcChars
. srcChars
is not modified.
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars. |
|
inline |
Set the characters in the UnicodeString object to the characters in srcChars
. srcChars
is not modified.
srcChars | the source for the new characters |
srcLength | the number of Unicode characters in srcChars. |
UnicodeString& UnicodeString::setTo | ( | UChar | srcChar | ) |
Set the characters in the UnicodeString object to the code unit srcChar
.
srcChar | the code unit which becomes the UnicodeString's character content |
UnicodeString& UnicodeString::setTo | ( | UChar | srcChar | ) |
Set the characters in the UnicodeString object to the code unit srcChar
.
srcChar | the code unit which becomes the UnicodeString's character content |
|
inline |
Set the characters in the UnicodeString object to the code unit srcChar
.
srcChar | the code unit which becomes the UnicodeString's character content |
|
inline |
Set the characters in the UnicodeString object to the code point srcChar
.
srcChar | the code point which becomes the UnicodeString's character content |
UnicodeString& UnicodeString::setTo | ( | UChar32 | srcChar | ) |
Set the characters in the UnicodeString object to the code point srcChar
.
srcChar | the code point which becomes the UnicodeString's character content |
UnicodeString& UnicodeString::setTo | ( | UChar32 | srcChar | ) |
Set the characters in the UnicodeString object to the code point srcChar
.
srcChar | the code point which becomes the UnicodeString's character content |
UnicodeString& UnicodeString::setTo | ( | UBool | isTerminated, |
const UChar * | text, | ||
int32_t | textLength | ||
) |
Aliasing setTo() function, analogous to the readonly-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has copy-on-write semantics: When the string is modified, then the buffer is first copied into newly allocated memory. The aliased buffer is never modified.
In an assignment to another UnicodeString, when using the copy constructor or the assignment operator, the text will be copied. When using fastCopyFrom(), the text will be aliased again, so that both strings then alias the same readonly-text.
isTerminated | specifies if text is NUL -terminated. This must be true if textLength==-1 . |
text | The characters to alias for the UnicodeString. |
textLength | The number of Unicode characters in text to alias. If -1, then this constructor will determine the length by calling u_strlen() . |
UnicodeString& UnicodeString::setTo | ( | UBool | isTerminated, |
const UChar * | text, | ||
int32_t | textLength | ||
) |
Aliasing setTo() function, analogous to the readonly-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has copy-on-write semantics: When the string is modified, then the buffer is first copied into newly allocated memory. The aliased buffer is never modified.
In an assignment to another UnicodeString, when using the copy constructor or the assignment operator, the text will be copied. When using fastCopyFrom(), the text will be aliased again, so that both strings then alias the same readonly-text.
isTerminated | specifies if text is NUL -terminated. This must be true if textLength==-1 . |
text | The characters to alias for the UnicodeString. |
textLength | The number of Unicode characters in text to alias. If -1, then this constructor will determine the length by calling u_strlen() . |
UnicodeString& UnicodeString::setTo | ( | UBool | isTerminated, |
const UChar * | text, | ||
int32_t | textLength | ||
) |
Aliasing setTo() function, analogous to the readonly-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has copy-on-write semantics: When the string is modified, then the buffer is first copied into newly allocated memory. The aliased buffer is never modified.
In an assignment to another UnicodeString, when using the copy constructor or the assignment operator, the text will be copied. When using fastCopyFrom(), the text will be aliased again, so that both strings then alias the same readonly-text.
isTerminated | specifies if text is NUL -terminated. This must be true if textLength==-1 . |
text | The characters to alias for the UnicodeString. |
textLength | The number of Unicode characters in text to alias. If -1, then this constructor will determine the length by calling u_strlen() . |
UnicodeString& UnicodeString::setTo | ( | UChar * | buffer, |
int32_t | buffLength, | ||
int32_t | buffCapacity | ||
) |
Aliasing setTo() function, analogous to the writable-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has write-through semantics: For as long as the capacity of the buffer is sufficient, write operations will directly affect the buffer. When more capacity is necessary, then a new buffer will be allocated and the contents copied as with regularly constructed strings. In an assignment to another UnicodeString, the buffer will be copied. The extract(UChar *dst) function detects whether the dst pointer is the same as the string buffer itself and will in this case not copy the contents.
buffer | The characters to alias for the UnicodeString. |
buffLength | The number of Unicode characters in buffer to alias. |
buffCapacity | The size of buffer in UChars. |
UnicodeString& UnicodeString::setTo | ( | UChar * | buffer, |
int32_t | buffLength, | ||
int32_t | buffCapacity | ||
) |
Aliasing setTo() function, analogous to the writable-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has write-through semantics: For as long as the capacity of the buffer is sufficient, write operations will directly affect the buffer. When more capacity is necessary, then a new buffer will be allocated and the contents copied as with regularly constructed strings. In an assignment to another UnicodeString, the buffer will be copied. The extract(UChar *dst) function detects whether the dst pointer is the same as the string buffer itself and will in this case not copy the contents.
buffer | The characters to alias for the UnicodeString. |
buffLength | The number of Unicode characters in buffer to alias. |
buffCapacity | The size of buffer in UChars. |
UnicodeString& UnicodeString::setTo | ( | UChar * | buffer, |
int32_t | buffLength, | ||
int32_t | buffCapacity | ||
) |
Aliasing setTo() function, analogous to the writable-aliasing UChar* constructor. The text will be used for the UnicodeString object, but it will not be released when the UnicodeString is destroyed. This has write-through semantics: For as long as the capacity of the buffer is sufficient, write operations will directly affect the buffer. When more capacity is necessary, then a new buffer will be allocated and the contents copied as with regularly constructed strings. In an assignment to another UnicodeString, the buffer will be copied. The extract(UChar *dst) function detects whether the dst pointer is the same as the string buffer itself and will in this case not copy the contents.
buffer | The characters to alias for the UnicodeString. |
buffLength | The number of Unicode characters in buffer to alias. |
buffCapacity | The size of buffer in UChars. |
void UnicodeString::setToBogus | ( | ) |
Make this UnicodeString object invalid. The string will test TRUE with isBogus().
A bogus string has no value. It is different from an empty string. It can be used to indicate that no string value is available. getBuffer() and getTerminatedBuffer() return NULL, and length() returns 0.
This utility function is used throughout the UnicodeString implementation to indicate that a UnicodeString operation failed, and may be used in other functions, especially but not exclusively when such functions do not take a UErrorCode for simplicity.
The following methods, and no others, will clear a string object's bogus flag:
The simplest ways to turn a bogus string into an empty one is to use the remove() function. Examples for other functions that are equivalent to "set to empty string":
void UnicodeString::setToBogus | ( | ) |
Make this UnicodeString object invalid. The string will test TRUE with isBogus().
A bogus string has no value. It is different from an empty string. It can be used to indicate that no string value is available. getBuffer() and getTerminatedBuffer() return NULL, and length() returns 0.
This utility function is used throughout the UnicodeString implementation to indicate that a UnicodeString operation failed, and may be used in other functions, especially but not exclusively when such functions do not take a UErrorCode for simplicity.
The following methods, and no others, will clear a string object's bogus flag:
The simplest ways to turn a bogus string into an empty one is to use the remove() function. Examples for other functions that are equivalent to "set to empty string":
void UnicodeString::setToBogus | ( | ) |
Make this UnicodeString object invalid. The string will test TRUE with isBogus().
A bogus string has no value. It is different from an empty string. It can be used to indicate that no string value is available. getBuffer() and getTerminatedBuffer() return NULL, and length() returns 0.
This utility function is used throughout the UnicodeString implementation to indicate that a UnicodeString operation failed, and may be used in other functions, especially but not exclusively when such functions do not take a UErrorCode for simplicity.
The following methods, and no others, will clear a string object's bogus flag:
The simplest ways to turn a bogus string into an empty one is to use the remove() function. Examples for other functions that are equivalent to "set to empty string":
|
inline |
Determine if this starts with the characters in text
text | The text to match. |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this starts with the characters in text
text | The text to match. |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this starts with the characters in text
text | The text to match. |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this starts with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
srcText | The text to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcText to match |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this starts with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
srcText | The text to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcText to match |
text
, FALSE otherwise ICU 2.0
|
inline |
Determine if this starts with the characters in srcText
in the range [srcStart
, srcStart + srcLength
).
srcText | The text to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcText to match |
text
, FALSE otherwise ICU 2.0 Determine if this starts with the characters in srcChars
srcChars | The characters to match. |
srcLength | the number of characters in srcChars |
srcChars
, FALSE otherwise ICU 2.0 Determine if this starts with the characters in srcChars
srcChars | The characters to match. |
srcLength | the number of characters in srcChars |
srcChars
, FALSE otherwise ICU 2.0 Determine if this starts with the characters in srcChars
srcChars | The characters to match. |
srcLength | the number of characters in srcChars |
srcChars
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
srcChars | The characters to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcChars to match |
srcChars
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
srcChars | The characters to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcChars to match |
srcChars
, FALSE otherwise ICU 2.0
|
inline |
Determine if this ends with the characters in srcChars
in the range [srcStart
, srcStart + srcLength
).
srcChars | The characters to match. |
srcStart | the offset into srcText to start matching |
srcLength | the number of characters in srcChars to match |
srcChars
, FALSE otherwise ICU 2.0 UnicodeString UnicodeString::tempSubString | ( | int32_t | start = 0 , |
int32_t | length = INT32_MAX |
||
) | const |
Create a temporary substring for the specified range. Unlike the substring constructor and setTo() functions, the object returned here will be a read-only alias (using getBuffer()) rather than copying the text. As a result, this substring operation is much faster but requires that the original string not be modified or deleted during the lifetime of the returned substring object.
start | offset of the first character visible in the substring |
length | length of the substring |
UnicodeString UnicodeString::tempSubString | ( | int32_t | start = 0 , |
int32_t | length = INT32_MAX |
||
) | const |
Create a temporary substring for the specified range. Unlike the substring constructor and setTo() functions, the object returned here will be a read-only alias (using getBuffer()) rather than copying the text. As a result, this substring operation is much faster but requires that the original string not be modified or deleted during the lifetime of the returned substring object.
start | offset of the first character visible in the substring |
length | length of the substring |
UnicodeString UnicodeString::tempSubString | ( | int32_t | start = 0 , |
int32_t | length = INT32_MAX |
||
) | const |
Create a temporary substring for the specified range. Unlike the substring constructor and setTo() functions, the object returned here will be a read-only alias (using getBuffer()) rather than copying the text. As a result, this substring operation is much faster but requires that the original string not be modified or deleted during the lifetime of the returned substring object.
start | offset of the first character visible in the substring |
length | length of the substring |
|
inline |
Create a temporary substring for the specified range. Same as tempSubString(start, length) except that the substring range is specified as a (start, limit) pair (with an exclusive limit index) rather than a (start, length) pair.
start | offset of the first character visible in the substring |
limit | offset immediately following the last character visible in the substring |
|
inline |
Create a temporary substring for the specified range. Same as tempSubString(start, length) except that the substring range is specified as a (start, limit) pair (with an exclusive limit index) rather than a (start, length) pair.
start | offset of the first character visible in the substring |
limit | offset immediately following the last character visible in the substring |
|
inline |
Create a temporary substring for the specified range. Same as tempSubString(start, length) except that the substring range is specified as a (start, limit) pair (with an exclusive limit index) rather than a (start, length) pair.
start | offset of the first character visible in the substring |
limit | offset immediately following the last character visible in the substring |
UnicodeString& UnicodeString::toLower | ( | void | ) |
Convert the characters in this to lower case following the conventions of the default locale.
UnicodeString& UnicodeString::toLower | ( | void | ) |
Convert the characters in this to lower case following the conventions of the default locale.
UnicodeString& UnicodeString::toLower | ( | void | ) |
Convert the characters in this to lower case following the conventions of the default locale.
UnicodeString& UnicodeString::toLower | ( | const Locale & | locale | ) |
UnicodeString& UnicodeString::toLower | ( | const Locale & | locale | ) |
UnicodeString& UnicodeString::toLower | ( | const Locale & | locale | ) |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter | ) |
Titlecase this string, convenience function using the default locale.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others.
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter | ) |
Titlecase this string, convenience function using the default locale.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others.
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter | ) |
Titlecase this string, convenience function using the default locale.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others.
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter, |
const Locale & | locale | ||
) |
Titlecase this string.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others.
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
locale | The locale to consider. |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter, |
const Locale & | locale | ||
) |
Titlecase this string.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others.
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
locale | The locale to consider. |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter, |
const Locale & | locale | ||
) |
Titlecase this string.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others.
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
locale | The locale to consider. |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter, |
const Locale & | locale, | ||
uint32_t | options | ||
) |
Titlecase this string, with options.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others. (This can be modified with options.)
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
locale | The locale to consider. |
options | Options bit set, see ucasemap_open(). |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter, |
const Locale & | locale, | ||
uint32_t | options | ||
) |
Titlecase this string, with options.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others. (This can be modified with options.)
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
locale | The locale to consider. |
options | Options bit set, see ucasemap_open(). |
UnicodeString& UnicodeString::toTitle | ( | BreakIterator * | titleIter, |
const Locale & | locale, | ||
uint32_t | options | ||
) |
Titlecase this string, with options.
Casing is locale-dependent and context-sensitive. Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others. (This can be modified with options.)
The titlecase break iterator can be provided to customize for arbitrary styles, using rules and dictionaries beyond the standard iterators. It may be more efficient to always provide an iterator to avoid opening and closing one for each string. The standard titlecase iterator for the root locale implements the algorithm of Unicode TR 21.
This function uses only the setText(), first() and next() methods of the provided break iterator.
titleIter | A break iterator to find the first characters of words that are to be titlecased. If none is provided (0), then a standard titlecase break iterator is opened. Otherwise the provided iterator is set to the string's text. |
locale | The locale to consider. |
options | Options bit set, see ucasemap_open(). |
UnicodeString& UnicodeString::toUpper | ( | void | ) |
Convert the characters in this to UPPER CASE following the conventions of the default locale.
UnicodeString& UnicodeString::toUpper | ( | void | ) |
Convert the characters in this to UPPER CASE following the conventions of the default locale.
UnicodeString& UnicodeString::toUpper | ( | void | ) |
Convert the characters in this to UPPER CASE following the conventions of the default locale.
UnicodeString& UnicodeString::toUpper | ( | const Locale & | locale | ) |
UnicodeString& UnicodeString::toUpper | ( | const Locale & | locale | ) |
UnicodeString& UnicodeString::toUpper | ( | const Locale & | locale | ) |
int32_t UnicodeString::toUTF32 | ( | UChar32 * | utf32, |
int32_t | capacity, | ||
UErrorCode & | errorCode | ||
) | const |
Convert the UnicodeString to UTF-32. Unpaired surrogates are replaced with U+FFFD. Calls u_strToUTF32WithSub().
utf32 | destination string buffer, can be NULL if capacity==0 |
capacity | the number of UChar32s available at utf32 |
errorCode | Standard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
int32_t UnicodeString::toUTF32 | ( | UChar32 * | utf32, |
int32_t | capacity, | ||
UErrorCode & | errorCode | ||
) | const |
Convert the UnicodeString to UTF-32. Unpaired surrogates are replaced with U+FFFD. Calls u_strToUTF32WithSub().
utf32 | destination string buffer, can be NULL if capacity==0 |
capacity | the number of UChar32s available at utf32 |
errorCode | Standard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
int32_t UnicodeString::toUTF32 | ( | UChar32 * | utf32, |
int32_t | capacity, | ||
UErrorCode & | errorCode | ||
) | const |
Convert the UnicodeString to UTF-32. Unpaired surrogates are replaced with U+FFFD. Calls u_strToUTF32WithSub().
utf32 | destination string buffer, can be NULL if capacity==0 |
capacity | the number of UChar32s available at utf32 |
errorCode | Standard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
Convert the UnicodeString to UTF-8 and write the result to a ByteSink. This is called by toUTF8String(). Unpaired surrogates are replaced with U+FFFD. Calls u_strToUTF8WithSub().
sink | A ByteSink to which the UTF-8 version of the string is written. sink.Flush() is called at the end. ICU 4.2 |
Convert the UnicodeString to UTF-8 and write the result to a ByteSink. This is called by toUTF8String(). Unpaired surrogates are replaced with U+FFFD. Calls u_strToUTF8WithSub().
sink | A ByteSink to which the UTF-8 version of the string is written. sink.Flush() is called at the end. ICU 4.2 |
Convert the UnicodeString to UTF-8 and write the result to a ByteSink. This is called by toUTF8String(). Unpaired surrogates are replaced with U+FFFD. Calls u_strToUTF8WithSub().
sink | A ByteSink to which the UTF-8 version of the string is written. sink.Flush() is called at the end. ICU 4.2 |
UnicodeString& UnicodeString::trim | ( | void | ) |
Trims leading and trailing whitespace from this UnicodeString.
UnicodeString& UnicodeString::trim | ( | void | ) |
Trims leading and trailing whitespace from this UnicodeString.
UnicodeString& UnicodeString::trim | ( | void | ) |
Trims leading and trailing whitespace from this UnicodeString.
Truncate this UnicodeString to the targetLength
.
targetLength | the desired length of this UnicodeString. |
Truncate this UnicodeString to the targetLength
.
targetLength | the desired length of this UnicodeString. |
Truncate this UnicodeString to the targetLength
.
targetLength | the desired length of this UnicodeString. |
UnicodeString UnicodeString::unescape | ( | ) | const |
Unescape a string of characters and return a string containing the result. The following escape sequences are recognized:
\uhhhh 4 hex digits; h in [0-9A-Fa-f] \Uhhhhhhhh 8 hex digits \xhh 1-2 hex digits \ooo 1-3 octal digits; o in [0-7] \cX control-X; X is masked with 0x1F
as well as the standard ANSI C escapes:
\a => U+0007, \b => U+0008, \t => U+0009, \n => U+000A, \v => U+000B, \f => U+000C, \r => U+000D, \e => U+001B, \" => U+0022, \' => U+0027, \? => U+003F, \\ => U+005C
Anything else following a backslash is generically escaped. For example, "[a\\-z]" returns "[a-z]".
If an escape sequence is ill-formed, this method returns an empty string. An example of an ill-formed sequence is "\\u" followed by fewer than 4 hex digits.
This function is similar to u_unescape() but not identical to it. The latter takes a source char*, so it does escape recognition and also invariant conversion.
UnicodeString UnicodeString::unescape | ( | ) | const |
Unescape a string of characters and return a string containing the result. The following escape sequences are recognized:
\uhhhh 4 hex digits; h in [0-9A-Fa-f] \Uhhhhhhhh 8 hex digits \xhh 1-2 hex digits \ooo 1-3 octal digits; o in [0-7] \cX control-X; X is masked with 0x1F
as well as the standard ANSI C escapes:
\a => U+0007, \b => U+0008, \t => U+0009, \n => U+000A, \v => U+000B, \f => U+000C, \r => U+000D, \e => U+001B, \" => U+0022, \' => U+0027, \? => U+003F, \\ => U+005C
Anything else following a backslash is generically escaped. For example, "[a\\-z]" returns "[a-z]".
If an escape sequence is ill-formed, this method returns an empty string. An example of an ill-formed sequence is "\\u" followed by fewer than 4 hex digits.
This function is similar to u_unescape() but not identical to it. The latter takes a source char*, so it does escape recognition and also invariant conversion.
UnicodeString UnicodeString::unescape | ( | ) | const |
Unescape a string of characters and return a string containing the result. The following escape sequences are recognized:
\uhhhh 4 hex digits; h in [0-9A-Fa-f] \Uhhhhhhhh 8 hex digits \xhh 1-2 hex digits \ooo 1-3 octal digits; o in [0-7] \cX control-X; X is masked with 0x1F
as well as the standard ANSI C escapes:
\a => U+0007, \b => U+0008, \t => U+0009, \n => U+000A, \v => U+000B, \f => U+000C, \r => U+000D, \e => U+001B, \" => U+0022, \' => U+0027, \? => U+003F, \\ => U+005C
Anything else following a backslash is generically escaped. For example, "[a\\-z]" returns "[a-z]".
If an escape sequence is ill-formed, this method returns an empty string. An example of an ill-formed sequence is "\\u" followed by fewer than 4 hex digits.
This function is similar to u_unescape() but not identical to it. The latter takes a source char*, so it does escape recognition and also invariant conversion.
Unescape a single escape sequence and return the represented character. See unescape() for a listing of the recognized escape sequences. The character at offset-1 is assumed (without checking) to be a backslash. If the escape sequence is ill-formed, or the offset is out of range, U_SENTINEL=-1 is returned.
offset | an input output parameter. On input, it is the offset into this string where the escape sequence is located, after the initial backslash. On output, it is advanced after the last character parsed. On error, it is not advanced at all. |
Unescape a single escape sequence and return the represented character. See unescape() for a listing of the recognized escape sequences. The character at offset-1 is assumed (without checking) to be a backslash. If the escape sequence is ill-formed, or the offset is out of range, U_SENTINEL=-1 is returned.
offset | an input output parameter. On input, it is the offset into this string where the escape sequence is located, after the initial backslash. On output, it is advanced after the last character parsed. On error, it is not advanced at all. |
Unescape a single escape sequence and return the represented character. See unescape() for a listing of the recognized escape sequences. The character at offset-1 is assumed (without checking) to be a backslash. If the escape sequence is ill-formed, or the offset is out of range, U_SENTINEL=-1 is returned.
offset | an input output parameter. On input, it is the offset into this string where the escape sequence is located, after the initial backslash. On output, it is advanced after the last character parsed. On error, it is not advanced at all. |
|
friend |
|
friend |
|
friend |