+// © 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.
*******************************************************************************
*/
#include "unicode/utypes.h"
+#if U_SHOW_CPLUSPLUS_API
+
#if !UCONFIG_NO_NORMALIZATION
#include "unicode/uobject.h"
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
* @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
*/
void setSource(const UnicodeString &newSource, UErrorCode &status);
+#ifndef U_HIDE_INTERNAL_API
/**
* Dumb recursive implementation of permutation.
* TODO: optimize
* @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.
/**
* 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);
// 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);
/**
* 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();
#endif /* #if !UCONFIG_NO_NORMALIZATION */
+#endif /* U_SHOW_CPLUSPLUS_API */
+
#endif