X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..340931cb2e044a2141d11567dd0f782524e32994:/icuSources/common/unicode/caniter.h diff --git a/icuSources/common/unicode/caniter.h b/icuSources/common/unicode/caniter.h index 84a65958..13e524ff 100644 --- a/icuSources/common/unicode/caniter.h +++ b/icuSources/common/unicode/caniter.h @@ -1,7 +1,9 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* - * Copyright (C) 1996-2006, International Business Machines Corporation and * - * others. All Rights Reserved. * + * Copyright (C) 1996-2014, International Business Machines Corporation and + * others. All Rights Reserved. ******************************************************************************* */ @@ -10,6 +12,8 @@ #include "unicode/utypes.h" +#if U_SHOW_CPLUSPLUS_API + #if !UCONFIG_NO_NORMALIZATION #include "unicode/uobject.h" @@ -31,6 +35,8 @@ U_NAMESPACE_BEGIN class Hashtable; +class Normalizer2; +class Normalizer2Impl; /** * This class allows one to iterate through all the strings that are canonically equivalent to a given @@ -67,7 +73,7 @@ Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMB * @author C++ port by V. Weinstein * @stable ICU 2.4 */ -class U_COMMON_API CanonicalIterator : public UObject { +class U_COMMON_API CanonicalIterator U_FINAL : public UObject { public: /** * Construct a CanonicalIterator object @@ -114,6 +120,7 @@ public: */ void setSource(const UnicodeString &newSource, UErrorCode &status); +#ifndef U_HIDE_INTERNAL_API /** * Dumb recursive implementation of permutation. * TODO: optimize @@ -124,6 +131,7 @@ public: * @internal */ static void U_EXPORT2 permute(UnicodeString &source, UBool skipZeros, Hashtable *result, UErrorCode &status); +#endif /* U_HIDE_INTERNAL_API */ /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -147,13 +155,13 @@ private: /** * Copy constructor. Private for now. - * @internal + * @internal (private) */ CanonicalIterator(const CanonicalIterator& other); /** * Assignment operator. Private for now. - * @internal + * @internal (private) */ CanonicalIterator& operator=(const CanonicalIterator& other); @@ -174,11 +182,14 @@ private: // transient fields UnicodeString buffer; + const Normalizer2 &nfd; + const Normalizer2Impl &nfcImpl; + // we have a segment, in NFD. Find all the strings that are canonically equivalent to it. UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &result_len, UErrorCode &status); //private String[] getEquivalents(String segment) //Set getEquivalents2(String segment); - Hashtable *getEquivalents2(Hashtable *fillinResult, const UChar *segment, int32_t segLen, UErrorCode &status); + Hashtable *getEquivalents2(Hashtable *fillinResult, const char16_t *segment, int32_t segLen, UErrorCode &status); //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segLen, UErrorCode &status); /** @@ -187,7 +198,7 @@ private: * If so, take the remainder, and return the equivalents */ //Set extract(int comp, String segment, int segmentPos, StringBuffer buffer); - Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status); + Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const char16_t *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status); //Hashtable *extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status); void cleanPieces(); @@ -198,4 +209,6 @@ U_NAMESPACE_END #endif /* #if !UCONFIG_NO_NORMALIZATION */ +#endif /* U_SHOW_CPLUSPLUS_API */ + #endif