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

U_INTERNAL int64_t U_EXPORT2 ucol_nextProcessed ( UCollationElements elems,
int32_t *  ixLow,
int32_t *  ixHigh,
UErrorCode status 
)

Get the processed ordering priority of the next collation element in the text. A single character may contain more than one collation element.

Parameters:
elems The UCollationElements containing the text.
ixLow a pointer to an int32_t to receive the iterator index before fetching the CE.
ixHigh a pointer to an int32_t to receive the iterator index after fetching the CE.
status A pointer to an UErrorCode to receive any errors.
Returns:
The next collation elements ordering, otherwise returns UCOL_PROCESSED_NULLORDER if an error has occured or if the end of string has been reached

For internal use only.

Definition at line 425 of file ucoleitr.cpp.

References FALSE, NULL, U_FAILURE, and UCOL_PROCESSED_NULLORDER.

{
    const UCollator *coll = elems->iteratordata_.coll;
    int64_t result = UCOL_IGNORABLE;
    uint32_t low = 0, high = 0;

    if (U_FAILURE(*status)) {
        return UCOL_PROCESSED_NULLORDER;
    }

    if (elems->pce == NULL) {
        elems->pce = new UCollationPCE(elems);
    } else {
        elems->pce->pceBuffer.reset();
    }

    elems->reset_ = FALSE;

    do {
        low = ucol_getOffset(elems);
        uint32_t ce = (uint32_t) ucol_getNextCE(coll, &elems->iteratordata_, status);
        high = ucol_getOffset(elems);

        if (ce == UCOL_NO_MORE_CES) {
             result = UCOL_PROCESSED_NULLORDER;
             break;
        }

        result = processCE(elems, ce);
    } while (result == UCOL_IGNORABLE);

    if (ixLow != NULL) {
        *ixLow = low;
    }

    if (ixHigh != NULL) {
        *ixHigh = high;
    }

    return result;
}


Generated by  Doxygen 1.6.0   Back to index