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

Collator::EComparisonResult RuleBasedCollator::compare ( const UnicodeString source,
const UnicodeString target,
int32_t  length 
) const [virtual]

Compares a range of character data stored in two different strings based on the collation rules up to the specified length. Returns information about whether a string is less than, greater than or equal to another string in a language. This can be overriden in a subclass.

source the source string.
target the target string to be compared with the source string.
length compares up to the specified length
the comparison result. GREATER if the source string is greater than the target string, LESS if the source is less than the target. Otherwise, returns EQUAL.
ICU 2.6 Use overload with UErrorCode&

Reimplemented from Collator.

Definition at line 332 of file tblcoll.cpp.

References compare(), UnicodeString::getBuffer(), getEComparisonResult(), UnicodeString::length(), and U_ZERO_ERROR.

    UErrorCode status = U_ZERO_ERROR;
    return getEComparisonResult(compare(source.getBuffer(), uprv_min(length,source.length()), target.getBuffer(), uprv_min(length,target.length()), status));

Generated by  Doxygen 1.6.0   Back to index