1 // © 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html 4 ******************************************************************************* 5 * Copyright (C) 1996-2014, International Business Machines Corporation and 6 * others. All Rights Reserved. 7 ******************************************************************************* 15 #if U_SHOW_CPLUSPLUS_API 17 #if !UCONFIG_NO_NORMALIZATION 31 #ifndef CANITER_SKIP_ZEROES 32 #define CANITER_SKIP_ZEROES true 123 #ifndef U_HIDE_INTERNAL_API 135 #endif/* U_HIDE_INTERNAL_API */ 152 // ===================== PRIVATES ============================== 153 // private default constructor 171 // 2 dimensional array holds the pieces of the string with 172 // their different canonically equivalent representations 174 int32_t pieces_length;
175 int32_t *pieces_lengths;
177 // current is used in iterating to combine pieces 179 int32_t current_length;
185 const Normalizer2Impl *nfcImpl;
187 // we have a segment, in NFD. Find all the strings that are canonically equivalent to it. 190 //Set getEquivalents2(String segment); 191 Hashtable *getEquivalents2(Hashtable *fillinResult,
const char16_t *segment, int32_t segLen,
UErrorCode &status);
192 //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segLen, UErrorCode &status); 199 //Set extract(int comp, String segment, int segmentPos, StringBuffer buffer); 200 Hashtable *extract(Hashtable *fillinResult,
UChar32 comp,
const char16_t *segment, int32_t segLen, int32_t segmentPos,
UErrorCode &status);
201 //Hashtable *extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status); 209 #endif/* #if !UCONFIG_NO_NORMALIZATION */ 211 #endif/* U_SHOW_CPLUSPLUS_API */ This class allows one to iterate through all the strings that are canonically equivalent to a given s...
void reset()
Resets the iterator so that one can start again from the beginning.
UnicodeString next()
Get the next canonically equivalent string.
static void permute(UnicodeString &source, UBool skipZeros, Hashtable *result, UErrorCode &status, int32_t depth=0)
Dumb recursive implementation of permutation.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
void setSource(const UnicodeString &newSource, UErrorCode &status)
Set a new source for this iterator.
virtual UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
CanonicalIterator(const UnicodeString &source, UErrorCode &status)
Construct a CanonicalIterator object.
UnicodeString getSource()
Gets the NFD form of the current source we are iterating over.
virtual ~CanonicalIterator()
Destructor Cleans pieces.
Unicode normalization functionality for standard Unicode normalization or for using custom mapping ta...
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
int8_t UBool
The ICU boolean type, a signed-byte integer.
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.