Access to the list of edits. More...
#include <edits.h>
Public Member Functions | |
| Iterator () | |
| Default constructor, empty iterator. | |
| Iterator (const Iterator &other) | |
| Copy constructor. | |
| Iterator & | operator= (const Iterator &other) |
| Assignment operator. | |
| UBool | next (UErrorCode &errorCode) |
| Advances to the next edit. | |
| UBool | findSourceIndex (int32_t i, UErrorCode &errorCode) |
| Finds the edit that contains the source index. | |
| UBool | findDestinationIndex (int32_t i, UErrorCode &errorCode) |
| Finds the edit that contains the destination index. | |
| int32_t | destinationIndexFromSourceIndex (int32_t i, UErrorCode &errorCode) |
| Returns the destination index corresponding to the given source index. | |
| int32_t | sourceIndexFromDestinationIndex (int32_t i, UErrorCode &errorCode) |
| Returns the source index corresponding to the given destination index. | |
| UBool | hasChange () const |
| int32_t | oldLength () const |
| int32_t | newLength () const |
| int32_t | sourceIndex () const |
| int32_t | replacementIndex () const |
| int32_t | destinationIndex () const |
Friends | |
| class | Edits |
Access to the list of edits.
Definition at line 143 of file edits.h.
| int32_t icu::final::final::destinationIndex | ( | ) | const [inline] |
| int32_t icu::final::final::destinationIndexFromSourceIndex | ( | int32_t | i, | |
| UErrorCode & | errorCode | |||
| ) |
Returns the destination index corresponding to the given source index.
If the source index is inside a change edit (not at its start), then the destination index at the end of that edit is returned, since there is no information about index mapping inside a change edit.
(This means that indexes to the start and middle of an edit, for example around a grapheme cluster, are mapped to indexes encompassing the entire edit. The alternative, mapping an interior index to the start, would map such an interval to an empty one.)
This operation will usually but not always modify this object. The iterator state after this search is undefined.
| i | source index | |
| errorCode | ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
| UBool icu::final::final::findDestinationIndex | ( | int32_t | i, | |
| UErrorCode & | errorCode | |||
| ) | [inline] |
Finds the edit that contains the destination index.
The destination index may be found in a non-change even if normal iteration would skip non-changes. Normal iteration can continue from a found edit.
The iterator state before this search logically does not matter. (It may affect the performance of the search.)
The iterator state after this search is undefined if the source index is out of bounds for the source string.
| i | destination index | |
| errorCode | ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
Definition at line 216 of file edits.h.
References FALSE.
| UBool icu::final::final::findSourceIndex | ( | int32_t | i, | |
| UErrorCode & | errorCode | |||
| ) | [inline] |
Finds the edit that contains the source index.
The source index may be found in a non-change even if normal iteration would skip non-changes. Normal iteration can continue from a found edit.
The iterator state before this search logically does not matter. (It may affect the performance of the search.)
The iterator state after this search is undefined if the source index is out of bounds for the source string.
| i | source index | |
| errorCode | ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
Definition at line 193 of file edits.h.
References TRUE.
| UBool icu::final::final::hasChange | ( | ) | const [inline] |
| icu::final::final::Iterator | ( | const Iterator & | other | ) |
Copy constructor.
| icu::final::final::Iterator | ( | ) | [inline] |
| int32_t icu::final::final::newLength | ( | ) | const [inline] |
| UBool icu::final::final::next | ( | UErrorCode & | errorCode | ) | [inline] |
Advances to the next edit.
| errorCode | ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
Definition at line 172 of file edits.h.
References next().
Referenced by next().
| int32_t icu::final::final::oldLength | ( | ) | const [inline] |
| Iterator& icu::final::final::operator= | ( | const Iterator & | other | ) |
Assignment operator.
| int32_t icu::final::final::replacementIndex | ( | ) | const [inline] |
| int32_t icu::final::final::sourceIndex | ( | ) | const [inline] |
| int32_t icu::final::final::sourceIndexFromDestinationIndex | ( | int32_t | i, | |
| UErrorCode & | errorCode | |||
| ) |
Returns the source index corresponding to the given destination index.
If the destination index is inside a change edit (not at its start), then the source index at the end of that edit is returned, since there is no information about index mapping inside a change edit.
(This means that indexes to the start and middle of an edit, for example around a grapheme cluster, are mapped to indexes encompassing the entire edit. The alternative, mapping an interior index to the start, would map such an interval to an empty one.)
This operation will usually but not always modify this object. The iterator state after this search is undefined.
| i | destination index | |
| errorCode | ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.) |
1.6.1