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

int32_t Transliterator::transliterate ( Replaceable text,
int32_t  start,
int32_t  limit 
) const [virtual, inherited]

Transliterates a segment of a string, with optional filtering.

Parameters:
text the string to be transliterated
start the beginning index, inclusive; 0 <= start <= limit.
limit the ending index, exclusive; start <= limit <= text.length().
Returns:
The new limit index. The text previously occupying [start, limit) has been transliterated, possibly to a string of a different length, at [start, new-limit), where new-limit is the return value. If the input offsets are out of bounds, the returned value is -1 and the input string remains unchanged. ICU 2.0
Transliterates a segment of a string. Transliterator API.
Parameters:
text the string to be transliterated
start the beginning index, inclusive; 0 <= start <= limit.
limit the ending index, exclusive; start <= limit <= text.length().
Returns:
the new limit index, or -1

Definition at line 189 of file translit.cpp.

References UTransPosition::contextLimit, UTransPosition::contextStart, FALSE, Transliterator::filteredTransliterate(), Replaceable::length(), UTransPosition::limit, UTransPosition::start, and TRUE.

Referenced by JamoTest::jamoToName(), JamoTest::nameToJamo(), FunctionReplacer::replace(), TransliteratorTest::TestAny(), TransliteratorTest::TestCompoundHex(), TransliteratorTest::TestFiltering(), TransliteratorTest::TestJ277(), TransliteratorTest::TestPositionHandling(), TransliteratorTest::TestThai(), and Transliterator::transliterate().

                                                                          {
    if (start < 0 ||
        limit < start ||
        text.length() < limit) {
        return -1;
    }

    UTransPosition offsets;
    offsets.contextStart= start;
    offsets.contextLimit = limit;
    offsets.start = start;
    offsets.limit = limit;
    filteredTransliterate(text, offsets, FALSE, TRUE);
    return offsets.limit;
}


Generated by  Doxygen 1.6.0   Back to index