Logo Search packages:      
Sourcecode: icu version File versions

UCollationResult RuleBasedCollator::compare ( const UChar source,
int32_t  sourceLength,
const UChar target,
int32_t  targetLength,
UErrorCode status 
) const [virtual]

The comparison function compares the character data stored in two different string arrays. Returns information about whether a string array is less than, greater than or equal to another string array.

Parameters:
sourcethe source string array to be compared with.
sourceLengththe length of the source string array. If this value is equal to -1, the string array is null-terminated.
targetthe string that is to be compared with the source string.
targetLengththe length of the target string array. If this value is equal to -1, the string array is null-terminated.
statuspossible error code
Returns:
Returns an enum value. UCOL_GREATER if source is greater than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less than target ICU 2.6

Implements Collator.

Definition at line 363 of file tblcoll.cpp.

References U_SUCCESS, UCOL_EQUAL, and ucollator.

{
    if(U_SUCCESS(status)) {
        return  ucol_strcoll(ucollator, source, sourceLength, target, targetLength);
    } else {
        return UCOL_EQUAL;
    }
}

Generated by  Doxygen 1.6.0   Back to index