ICU 59.1
59.1
|
Records lengths of string edits but not replacement text. More...
#include <edits.h>
Data Structures | |
struct | Iterator |
Access to the list of edits. More... | |
Public Member Functions | |
Edits () | |
Constructs an empty object. More... | |
~Edits () | |
Destructor. More... | |
void | reset () |
Resets the data but may not release memory. More... | |
void | addUnchanged (int32_t unchangedLength) |
Adds a record for an unchanged segment of text. More... | |
void | addReplace (int32_t oldLength, int32_t newLength) |
Adds a record for a text replacement/insertion/deletion. More... | |
UBool | copyErrorTo (UErrorCode &outErrorCode) |
Sets the UErrorCode if an error occurred while recording edits. More... | |
int32_t | lengthDelta () const |
How much longer is the new text compared with the old text? More... | |
UBool | hasChanges () const |
Iterator | getCoarseChangesIterator () const |
Returns an Iterator for coarse-grained changes for simple string updates. More... | |
Iterator | getCoarseIterator () const |
Returns an Iterator for coarse-grained changes and non-changes for simple string updates. More... | |
Iterator | getFineChangesIterator () const |
Returns an Iterator for fine-grained changes for modifying styled text. More... | |
Iterator | getFineIterator () const |
Returns an Iterator for fine-grained changes and non-changes for modifying styled text. More... | |
Records lengths of string edits but not replacement text.
Supports replacements, insertions, deletions in linear progression. Does not support moving/reordering of text.
An Edits object tracks a separate UErrorCode, but ICU string transformation functions (e.g., case mapping functions) merge any such errors into their API's UErrorCode.
|
inline |
icu::Edits::~Edits | ( | ) |
Destructor.
void icu::Edits::addReplace | ( | int32_t | oldLength, |
int32_t | newLength | ||
) |
Adds a record for a text replacement/insertion/deletion.
Normally called from inside ICU string transformation functions, not user code.
void icu::Edits::addUnchanged | ( | int32_t | unchangedLength | ) |
Adds a record for an unchanged segment of text.
Normally called from inside ICU string transformation functions, not user code.
UBool icu::Edits::copyErrorTo | ( | UErrorCode & | outErrorCode | ) |
Sets the UErrorCode if an error occurred while recording edits.
Preserves older error codes in the outErrorCode. Normally called from inside ICU string transformation functions, not user code.
|
inline |
|
inline |
|
inline |
|
inline |
UBool icu::Edits::hasChanges | ( | ) | const |
|
inline |
void icu::Edits::reset | ( | ) |
Resets the data but may not release memory.