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

U_STABLE int64_t U_EXPORT2 utext_getNativeIndex ( const UText ut  ) 

Get the current iterator position, which can range from 0 to the length of the text. The position is a native index into the input text, in whatever format it may have (possibly UTF-8 for example), and may not always be the same as the corresponding UChar (UTF-16) index. The returned position will always be aligned to a code point boundary.

Parameters:
ut the text to be accessed.
Returns:
the current index position, in the native units of the text provider. ICU 3.4

Definition at line 94 of file utext.cpp.

References UText::chunkNativeStart, UText::chunkOffset, UTextFuncs::mapOffsetToNative, UText::nativeIndexingLimit, and UText::pFuncs.

                                      {
    if(ut->chunkOffset <= ut->nativeIndexingLimit) {
        return ut->chunkNativeStart+ut->chunkOffset;
    } else {
        return ut->pFuncs->mapOffsetToNative(ut);
    }
}


Generated by  Doxygen 1.6.0   Back to index