Logo Search packages:      
Sourcecode: icu version File versions  Download package

int8_t UnicodeString::compareCodePointOrder ( const UChar *  srcChars,
int32_t  srcLength 
) const [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.

Parameters:
srcChars A pointer to another string to compare this one to.
srcLength The number of code units from that string to compare.
Returns:
a negative/zero/positive integer corresponding to whether this string is less than/equal to/greater than the second one in code point order ICU 2.0

Definition at line 3648 of file unistr.h.

References length().

{ return doCompareCodePointOrder(0, length(), srcChars, 0, srcLength); }


Generated by  Doxygen 1.6.0   Back to index