Go to the documentation of this file.
84 array(stackArray), capacity(STACK_CAPACITY), length(0), delta(0), numChanges(0),
92 array(stackArray), capacity(STACK_CAPACITY), length(other.length),
93 delta(other.delta), numChanges(other.numChanges),
94 errorCode_(other.errorCode_) {
104 array(stackArray), capacity(STACK_CAPACITY), length(src.length),
105 delta(src.delta), numChanges(src.numChanges),
106 errorCode_(src.errorCode_) {
145 void addUnchanged(int32_t unchangedLength);
151 void addReplace(int32_t oldLength, int32_t newLength);
169 int32_t lengthDelta()
const {
return delta; }
206 array(nullptr), index(0), length(0),
207 remaining(0), onlyChanges_(
FALSE), coarse(
FALSE),
208 dir(0), changed(
FALSE), oldLength_(0), newLength_(0),
209 srcIndex(0), replIndex(0), destIndex(0) {}
251 return findIndex(i,
TRUE, errorCode) == 0;
274 return findIndex(i,
FALSE, errorCode) == 0;
299 int32_t destinationIndexFromSourceIndex(int32_t i,
UErrorCode &errorCode);
323 int32_t sourceIndexFromDestinationIndex(int32_t i,
UErrorCode &errorCode);
391 #ifndef U_HIDE_INTERNAL_API
398 #endif // U_HIDE_INTERNAL_API
405 int32_t readLength(int32_t head);
406 void updateNextIndexes();
407 void updatePreviousIndexes();
414 const uint16_t *array;
415 int32_t index, length;
419 UBool onlyChanges_, coarse;
423 int32_t oldLength_, newLength_;
424 int32_t srcIndex, replIndex, destIndex;
508 void setLastUnit(int32_t last) { array[length - 1] = (uint16_t)last; }
509 int32_t lastUnit()
const {
return length > 0 ? array[length - 1] : 0xffff; }
511 void append(int32_t r);
514 static const int32_t STACK_CAPACITY = 100;
521 uint16_t stackArray[STACK_CAPACITY];
526 #endif // __EDITS_H__
#define FALSE
The FALSE value of a UBool.
Iterator getFineChangesIterator() const
Returns an Iterator for fine-grained change edits (full granularity of change edits is retained).
int32_t newLength() const
The length of the current span in the destination string, which starts at destinationIndex,...
Basic definitions for ICU, for both C and C++ APIs.
int32_t numberOfChanges() const
int8_t UBool
The ICU boolean type.
UBool next(UErrorCode &errorCode)
Advances the iterator to the next edit.
UBool findDestinationIndex(int32_t i, UErrorCode &errorCode)
Moves the iterator to the edit that contains the destination index.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Records lengths of string edits but not replacement text.
#define TRUE
The TRUE value of a UBool.
Iterator getFineIterator() const
Returns an Iterator for fine-grained change and no-change edits (full granularity of change edits is ...
UBool hasChange() const
Returns whether the edit currently represented by the iterator is a change edit.
UMemory is the common ICU base class.
int32_t oldLength() const
The length of the current span in the source string, which starts at sourceIndex.
Iterator getCoarseIterator() const
Returns an Iterator for coarse-grained change and no-change edits (adjacent change edits are treated ...
Iterator getCoarseChangesIterator() const
Returns an Iterator for coarse-grained change edits (adjacent change edits are treated as one).
UBool findSourceIndex(int32_t i, UErrorCode &errorCode)
Moves the iterator to the edit that contains the source index.
int32_t sourceIndex() const
The start index of the current span in the source string; the span has length oldLength.
Iterator()
Default constructor, empty iterator.
int32_t replacementIndex() const
The start index of the current span in the replacement string; the span has length newLength.
int32_t destinationIndex() const
The start index of the current span in the destination string; the span has length newLength.
Edits()
Constructs an empty object.
Edits(Edits &&src) U_NOEXCEPT
Move constructor, might leave src empty.
Access to the list of edits.
C++ API: Common ICU base class UObject.
Edits(const Edits &other)
Copy constructor.
#define U_NAMESPACE_BEGIN