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

void Transliterator::transliterate ( Replaceable text,
UTransPosition index,
const UnicodeString insertion,
UErrorCode status 
) const [virtual, inherited]

Transliterates the portion of the text buffer that can be transliterated unambiguosly after new text has been inserted, typically as a result of a keyboard event. The new text in insertion will be inserted into text at index.limit, advancing index.limit by insertion.length(). Then the transliterator will try to transliterate characters of text between index.cursor and index.limit. Characters before index.cursor will not be changed.

Upon return, values in index will be updated. index.start will be advanced to the first character that future calls to this method will read. index.cursor and index.limit will be adjusted to delimit the range of text that future calls to this method may change.

Typical usage of this method begins with an initial call with index.start and index.limit set to indicate the portion of text to be transliterated, and index.cursor == index.start. Thereafter, index can be used without modification in future calls, provided that all changes to text are made via this method.

This method assumes that future calls may be made that will insert new text into the buffer. As a result, it only performs unambiguous transliterations. After the last call to this method, there may be untransliterated text that is waiting for more input to resolve an ambiguity. In order to perform these pending transliterations, clients should call finishTransliteration after the last call to this method has been made.

Parameters:
text the buffer holding transliterated and untransliterated text
index an array of three integers.
  • index.start: the beginning index, inclusive; 0 <= index.start <= index.limit.

  • index.limit: the ending index, exclusive; index.start <= index.limit <= text.length(). insertion is inserted at index.limit.

  • index.cursor: the next character to be considered for transliteration; index.start <= index.cursor <= index.limit. Characters before index.cursor will not be changed by future calls to this method.

Parameters:
insertion text to be inserted and possibly transliterated into the translation buffer at index.limit. If null then no text is inserted.
status Output param to filled in with a success or an error.
See also:
handleTransliterate
Exceptions:
IllegalArgumentException if index is invalid
See also:
UTransPosition ICU 2.0
Transliterates the portion of the text buffer that can be transliterated unambiguosly after new text has been inserted, typically as a result of a keyboard event. The new text in insertion will be inserted into text at index.contextLimit, advancing index.contextLimit by insertion.length(). Then the transliterator will try to transliterate characters of text between index.start and index.contextLimit. Characters before index.start will not be changed.

Upon return, values in index will be updated. index.contextStart will be advanced to the first character that future calls to this method will read. index.start and index.contextLimit will be adjusted to delimit the range of text that future calls to this method may change.

Typical usage of this method begins with an initial call with index.contextStart and index.contextLimit set to indicate the portion of text to be transliterated, and index.start == index.contextStart. Thereafter, index can be used without modification in future calls, provided that all changes to text are made via this method.

This method assumes that future calls may be made that will insert new text into the buffer. As a result, it only performs unambiguous transliterations. After the last call to this method, there may be untransliterated text that is waiting for more input to resolve an ambiguity. In order to perform these pending transliterations, clients should call finishKeyboardTransliteration after the last call to this method has been made.

Parameters:
text the buffer holding transliterated and untransliterated text
index an array of three integers.
  • index.contextStart: the beginning index, inclusive; 0 <= index.contextStart <= index.contextLimit.

  • index.contextLimit: the ending index, exclusive; index.contextStart <= index.contextLimit <= text.length(). insertion is inserted at index.contextLimit.

  • index.start: the next character to be considered for transliteration; index.contextStart <= index.start <= index.contextLimit. Characters before index.start will not be changed by future calls to this method.

Parameters:
insertion text to be inserted and possibly transliterated into the translation buffer at index.contextLimit. If null then no text is inserted.
See also:
START

LIMIT

CURSOR

handleTransliterate

Exceptions:
IllegalArgumentException if index is invalid

Definition at line 278 of file translit.cpp.

References Transliterator::_transliterate().

                                                             {
    _transliterate(text, index, &insertion, status);
}


Generated by  Doxygen 1.6.0   Back to index