Logo Search packages:      
Sourcecode: icu version File versions

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.

Parameters:
sourcethe source string.
targetthe target string to be compared with the source string.
lengthcompares up to the specified length
Returns:
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.
Deprecated:
ICU 2.6 Use overload with UErrorCode&

Reimplemented from Collator.

Definition at line 335 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));
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index