ICU 59.1  59.1
Public Member Functions | Friends
icu::Edits::Iterator Struct Referencefinal

Access to the list of edits. More...

#include <edits.h>

Inheritance diagram for icu::Edits::Iterator:
icu::UMemory

Public Member Functions

 Iterator (const Iterator &other)=default
 Copy constructor. More...
 
Iteratoroperator= (const Iterator &other)=default
 Assignment operator. More...
 
UBool next (UErrorCode &errorCode)
 Advances to the next edit. More...
 
UBool findSourceIndex (int32_t i, UErrorCode &errorCode)
 Finds the edit that contains the source index. More...
 
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
 

Detailed Description

Access to the list of edits.

See also
getCoarseIterator
getFineIterator
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 92 of file edits.h.

Constructor & Destructor Documentation

§ Iterator()

icu::Edits::Iterator::Iterator ( const Iterator other)
default

Copy constructor.

Draft:
This API may be changed in the future versions and was introduced in ICU 59

Member Function Documentation

§ destinationIndex()

int32_t icu::Edits::Iterator::destinationIndex ( ) const
inline
Returns
the current index into the full destination string
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 162 of file edits.h.

§ findSourceIndex()

UBool icu::Edits::Iterator::findSourceIndex ( int32_t  i,
UErrorCode errorCode 
)

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.

Parameters
isource index
Returns
TRUE if the edit for the source index was found
Draft:
This API may be changed in the future versions and was introduced in ICU 59

§ hasChange()

UBool icu::Edits::Iterator::hasChange ( ) const
inline
Returns
TRUE if this edit replaces oldLength() units with newLength() different ones. FALSE if oldLength units remain unchanged.
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 134 of file edits.h.

§ newLength()

int32_t icu::Edits::Iterator::newLength ( ) const
inline
Returns
the number of units in the modified string, if hasChange() is TRUE. Same as oldLength if hasChange() is FALSE.
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 145 of file edits.h.

§ next()

UBool icu::Edits::Iterator::next ( UErrorCode errorCode)
inline

Advances to the next edit.

Returns
TRUE if there is another edit
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 109 of file edits.h.

References next().

Referenced by next().

§ oldLength()

int32_t icu::Edits::Iterator::oldLength ( ) const
inline
Returns
the number of units in the original string which are replaced or remain unchanged.
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 139 of file edits.h.

§ operator=()

Iterator& icu::Edits::Iterator::operator= ( const Iterator other)
default

Assignment operator.

Draft:
This API may be changed in the future versions and was introduced in ICU 59

§ replacementIndex()

int32_t icu::Edits::Iterator::replacementIndex ( ) const
inline
Returns
the current index into the replacement-characters-only string, not counting unchanged spans
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 157 of file edits.h.

§ sourceIndex()

int32_t icu::Edits::Iterator::sourceIndex ( ) const
inline
Returns
the current index into the source string
Draft:
This API may be changed in the future versions and was introduced in ICU 59

Definition at line 151 of file edits.h.


The documentation for this struct was generated from the following file: