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

int32_t SearchIterator::preceding ( int32_t  position,
UErrorCode status 
) [inherited]

Returns the first index less than position at which the string text matches the search pattern. The iterator is adjusted so that its current index (as returned by getOffset) is the match position if one was found. If a match is not found, USEARCH_DONE will be returned and the iterator will be adjusted to the index USEARCH_DONE

Parameters:
position where search is to start from. If position is less than or greater than the text range for searching, an U_INDEX_OUTOFBOUNDS_ERROR will be returned
status for errors if it occurs
Returns:
The character index of the first match preceding position, or USEARCH_DONE if there are no matches.
See also:
getOffset ICU 2.0

Definition at line 226 of file search.cpp.

References SearchIterator::handlePrev(), SearchIterator::setOffset(), U_FAILURE, and USEARCH_DONE.

{
    if (U_FAILURE(status)) {
        return USEARCH_DONE;
    }
    setOffset(position, status);
    return handlePrev(position, status);
}


Generated by  Doxygen 1.6.0   Back to index