X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/i18n/nortrans.h diff --git a/icuSources/i18n/nortrans.h b/icuSources/i18n/nortrans.h index 1e76deb3..d309452f 100644 --- a/icuSources/i18n/nortrans.h +++ b/icuSources/i18n/nortrans.h @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** -* Copyright (C) 2001-2002, International Business Machines +* Copyright (C) 2001-2010, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description @@ -15,7 +17,7 @@ #if !UCONFIG_NO_TRANSLITERATION #include "unicode/translit.h" -#include "unicode/normlzr.h" +#include "unicode/normalizer2.h" U_NAMESPACE_BEGIN @@ -23,23 +25,8 @@ U_NAMESPACE_BEGIN * A transliterator that performs normalization. * @author Alan Liu */ -class U_I18N_API NormalizationTransliterator : public Transliterator { - - /** - * The normalization mode of this transliterator. - */ - UNormalizationMode fMode; - - /** - * Normalization options for this transliterator. - */ - int32_t options; - - /** - * The address of this static class variable serves as this class's ID - * for ICU "poor man's RTTI". - */ - static const char fgClassID; +class NormalizationTransliterator : public Transliterator { + const Normalizer2 &fNorm2; public: @@ -53,30 +40,21 @@ class U_I18N_API NormalizationTransliterator : public Transliterator { */ NormalizationTransliterator(const NormalizationTransliterator&); - /** - * Assignment operator. - */ - NormalizationTransliterator& operator=(const NormalizationTransliterator&); - /** * Transliterator API. * @return A copy of the object. */ - Transliterator* clone(void) const; + virtual Transliterator* clone(void) const; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. - * - * @draft ICU 2.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + virtual UClassID getDynamicClassID() const; /** * ICU "poor man's RTTI", returns a UClassID for this class. - * - * @draft ICU 2.2 */ - static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; } + U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); protected: @@ -89,7 +67,7 @@ class U_I18N_API NormalizationTransliterator : public Transliterator { * @param incremental if true, assume more text may be coming after * pos.contextLimit. Otherwise, assume the text is complete. */ - void handleTransliterate(Replaceable& text, UTransPosition& offset, + virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, UBool isIncremental) const; public: @@ -108,8 +86,13 @@ class U_I18N_API NormalizationTransliterator : public Transliterator { * Constructs a transliterator. This method is private. * Public users must use the factory method createInstance(). */ - NormalizationTransliterator(const UnicodeString& id, - UNormalizationMode mode, int32_t opt); + NormalizationTransliterator(const UnicodeString& id, const Normalizer2 &norm2); + +private: + /** + * Assignment operator. + */ + NormalizationTransliterator& operator=(const NormalizationTransliterator&); }; U_NAMESPACE_END