Path: blob/jdk8u272-b10-aarch32-20201026/jdk/src/share/native/common/unicode/normlzr.h
48773 views
// © 2016 and later: Unicode, Inc. and others.1// License & terms of use: http://www.unicode.org/copyright.html2/*3********************************************************************4* COPYRIGHT:5* Copyright (c) 1996-2015, International Business Machines Corporation and6* others. All Rights Reserved.7********************************************************************8*/910#ifndef NORMLZR_H11#define NORMLZR_H1213#include "unicode/utypes.h"1415/**16* \file17* \brief C++ API: Unicode Normalization18*/1920#if !UCONFIG_NO_NORMALIZATION2122#include "unicode/chariter.h"23#include "unicode/normalizer2.h"24#include "unicode/unistr.h"25#include "unicode/unorm.h"26#include "unicode/uobject.h"2728U_NAMESPACE_BEGIN29/**30* Old Unicode normalization API.31*32* This API has been replaced by the Normalizer2 class and is only available33* for backward compatibility. This class simply delegates to the Normalizer2 class.34* There is one exception: The new API does not provide a replacement for Normalizer::compare().35*36* The Normalizer class supports the standard normalization forms described in37* <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">38* Unicode Standard Annex #15: Unicode Normalization Forms</a>.39*40* The Normalizer class consists of two parts:41* - static functions that normalize strings or test if strings are normalized42* - a Normalizer object is an iterator that takes any kind of text and43* provides iteration over its normalized form44*45* The Normalizer class is not suitable for subclassing.46*47* For basic information about normalization forms and details about the C API48* please see the documentation in unorm.h.49*50* The iterator API with the Normalizer constructors and the non-static functions51* use a CharacterIterator as input. It is possible to pass a string which52* is then internally wrapped in a CharacterIterator.53* The input text is not normalized all at once, but incrementally where needed54* (providing efficient random access).55* This allows to pass in a large text but spend only a small amount of time56* normalizing a small part of that text.57* However, if the entire text is normalized, then the iterator will be58* slower than normalizing the entire text at once and iterating over the result.59* A possible use of the Normalizer iterator is also to report an index into the60* original text that is close to where the normalized characters come from.61*62* <em>Important:</em> The iterator API was cleaned up significantly for ICU 2.0.63* The earlier implementation reported the getIndex() inconsistently,64* and previous() could not be used after setIndex(), next(), first(), and current().65*66* Normalizer allows to start normalizing from anywhere in the input text by67* calling setIndexOnly(), first(), or last().68* Without calling any of these, the iterator will start at the beginning of the text.69*70* At any time, next() returns the next normalized code point (UChar32),71* with post-increment semantics (like CharacterIterator::next32PostInc()).72* previous() returns the previous normalized code point (UChar32),73* with pre-decrement semantics (like CharacterIterator::previous32()).74*75* current() returns the current code point76* (respectively the one at the newly set index) without moving77* the getIndex(). Note that if the text at the current position78* needs to be normalized, then these functions will do that.79* (This is why current() is not const.)80* It is more efficient to call setIndexOnly() instead, which does not81* normalize.82*83* getIndex() always refers to the position in the input text where the normalized84* code points are returned from. It does not always change with each returned85* code point.86* The code point that is returned from any of the functions87* corresponds to text at or after getIndex(), according to the88* function's iteration semantics (post-increment or pre-decrement).89*90* next() returns a code point from at or after the getIndex()91* from before the next() call. After the next() call, the getIndex()92* might have moved to where the next code point will be returned from93* (from a next() or current() call).94* This is semantically equivalent to array access with array[index++]95* (post-increment semantics).96*97* previous() returns a code point from at or after the getIndex()98* from after the previous() call.99* This is semantically equivalent to array access with array[--index]100* (pre-decrement semantics).101*102* Internally, the Normalizer iterator normalizes a small piece of text103* starting at the getIndex() and ending at a following "safe" index.104* The normalized results is stored in an internal string buffer, and105* the code points are iterated from there.106* With multiple iteration calls, this is repeated until the next piece107* of text needs to be normalized, and the getIndex() needs to be moved.108*109* The following "safe" index, the internal buffer, and the secondary110* iteration index into that buffer are not exposed on the API.111* This also means that it is currently not practical to return to112* a particular, arbitrary position in the text because one would need to113* know, and be able to set, in addition to the getIndex(), at least also the114* current index into the internal buffer.115* It is currently only possible to observe when getIndex() changes116* (with careful consideration of the iteration semantics),117* at which time the internal index will be 0.118* For example, if getIndex() is different after next() than before it,119* then the internal index is 0 and one can return to this getIndex()120* later with setIndexOnly().121*122* Note: While the setIndex() and getIndex() refer to indices in the123* underlying Unicode input text, the next() and previous() methods124* iterate through characters in the normalized output.125* This means that there is not necessarily a one-to-one correspondence126* between characters returned by next() and previous() and the indices127* passed to and returned from setIndex() and getIndex().128* It is for this reason that Normalizer does not implement the CharacterIterator interface.129*130* @author Laura Werner, Mark Davis, Markus Scherer131* @stable ICU 2.0132*/133class U_COMMON_API Normalizer : public UObject {134public:135#ifndef U_HIDE_DEPRECATED_API136/**137* If DONE is returned from an iteration function that returns a code point,138* then there are no more normalization results available.139* @deprecated ICU 56 Use Normalizer2 instead.140*/141enum {142DONE=0xffff143};144145// Constructors146147/**148* Creates a new <code>Normalizer</code> object for iterating over the149* normalized form of a given string.150* <p>151* @param str The string to be normalized. The normalization152* will start at the beginning of the string.153*154* @param mode The normalization mode.155* @deprecated ICU 56 Use Normalizer2 instead.156*/157Normalizer(const UnicodeString& str, UNormalizationMode mode);158159/**160* Creates a new <code>Normalizer</code> object for iterating over the161* normalized form of a given string.162* <p>163* @param str The string to be normalized. The normalization164* will start at the beginning of the string.165*166* @param length Length of the string, or -1 if NUL-terminated.167* @param mode The normalization mode.168* @deprecated ICU 56 Use Normalizer2 instead.169*/170Normalizer(ConstChar16Ptr str, int32_t length, UNormalizationMode mode);171172/**173* Creates a new <code>Normalizer</code> object for iterating over the174* normalized form of the given text.175* <p>176* @param iter The input text to be normalized. The normalization177* will start at the beginning of the string.178*179* @param mode The normalization mode.180* @deprecated ICU 56 Use Normalizer2 instead.181*/182Normalizer(const CharacterIterator& iter, UNormalizationMode mode);183#endif /* U_HIDE_DEPRECATED_API */184185/**186* Copy constructor.187* @param copy The object to be copied.188* @deprecated ICU 56 Use Normalizer2 instead.189*/190Normalizer(const Normalizer& copy);191192/**193* Destructor194* @deprecated ICU 56 Use Normalizer2 instead.195*/196virtual ~Normalizer();197198199//-------------------------------------------------------------------------200// Static utility methods201//-------------------------------------------------------------------------202203#ifndef U_HIDE_DEPRECATED_API204/**205* Normalizes a <code>UnicodeString</code> according to the specified normalization mode.206* This is a wrapper for unorm_normalize(), using UnicodeString's.207*208* The <code>options</code> parameter specifies which optional209* <code>Normalizer</code> features are to be enabled for this operation.210*211* @param source the input string to be normalized.212* @param mode the normalization mode213* @param options the optional features to be enabled (0 for no options)214* @param result The normalized string (on output).215* @param status The error code.216* @deprecated ICU 56 Use Normalizer2 instead.217*/218static void U_EXPORT2 normalize(const UnicodeString& source,219UNormalizationMode mode, int32_t options,220UnicodeString& result,221UErrorCode &status);222223/**224* Compose a <code>UnicodeString</code>.225* This is equivalent to normalize() with mode UNORM_NFC or UNORM_NFKC.226* This is a wrapper for unorm_normalize(), using UnicodeString's.227*228* The <code>options</code> parameter specifies which optional229* <code>Normalizer</code> features are to be enabled for this operation.230*231* @param source the string to be composed.232* @param compat Perform compatibility decomposition before composition.233* If this argument is <code>FALSE</code>, only canonical234* decomposition will be performed.235* @param options the optional features to be enabled (0 for no options)236* @param result The composed string (on output).237* @param status The error code.238* @deprecated ICU 56 Use Normalizer2 instead.239*/240static void U_EXPORT2 compose(const UnicodeString& source,241UBool compat, int32_t options,242UnicodeString& result,243UErrorCode &status);244245/**246* Static method to decompose a <code>UnicodeString</code>.247* This is equivalent to normalize() with mode UNORM_NFD or UNORM_NFKD.248* This is a wrapper for unorm_normalize(), using UnicodeString's.249*250* The <code>options</code> parameter specifies which optional251* <code>Normalizer</code> features are to be enabled for this operation.252*253* @param source the string to be decomposed.254* @param compat Perform compatibility decomposition.255* If this argument is <code>FALSE</code>, only canonical256* decomposition will be performed.257* @param options the optional features to be enabled (0 for no options)258* @param result The decomposed string (on output).259* @param status The error code.260* @deprecated ICU 56 Use Normalizer2 instead.261*/262static void U_EXPORT2 decompose(const UnicodeString& source,263UBool compat, int32_t options,264UnicodeString& result,265UErrorCode &status);266267/**268* Performing quick check on a string, to quickly determine if the string is269* in a particular normalization format.270* This is a wrapper for unorm_quickCheck(), using a UnicodeString.271*272* Three types of result can be returned UNORM_YES, UNORM_NO or273* UNORM_MAYBE. Result UNORM_YES indicates that the argument274* string is in the desired normalized format, UNORM_NO determines that275* argument string is not in the desired normalized format. A276* UNORM_MAYBE result indicates that a more thorough check is required,277* the user may have to put the string in its normalized form and compare the278* results.279* @param source string for determining if it is in a normalized format280* @param mode normalization format281* @param status A reference to a UErrorCode to receive any errors282* @return UNORM_YES, UNORM_NO or UNORM_MAYBE283*284* @see isNormalized285* @deprecated ICU 56 Use Normalizer2 instead.286*/287static inline UNormalizationCheckResult288quickCheck(const UnicodeString &source, UNormalizationMode mode, UErrorCode &status);289290/**291* Performing quick check on a string; same as the other version of quickCheck292* but takes an extra options parameter like most normalization functions.293*294* @param source string for determining if it is in a normalized format295* @param mode normalization format296* @param options the optional features to be enabled (0 for no options)297* @param status A reference to a UErrorCode to receive any errors298* @return UNORM_YES, UNORM_NO or UNORM_MAYBE299*300* @see isNormalized301* @deprecated ICU 56 Use Normalizer2 instead.302*/303static UNormalizationCheckResult304quickCheck(const UnicodeString &source, UNormalizationMode mode, int32_t options, UErrorCode &status);305306/**307* Test if a string is in a given normalization form.308* This is semantically equivalent to source.equals(normalize(source, mode)) .309*310* Unlike unorm_quickCheck(), this function returns a definitive result,311* never a "maybe".312* For NFD, NFKD, and FCD, both functions work exactly the same.313* For NFC and NFKC where quickCheck may return "maybe", this function will314* perform further tests to arrive at a TRUE/FALSE result.315*316* @param src String that is to be tested if it is in a normalization format.317* @param mode Which normalization form to test for.318* @param errorCode ICU error code in/out parameter.319* Must fulfill U_SUCCESS before the function call.320* @return Boolean value indicating whether the source string is in the321* "mode" normalization form.322*323* @see quickCheck324* @deprecated ICU 56 Use Normalizer2 instead.325*/326static inline UBool327isNormalized(const UnicodeString &src, UNormalizationMode mode, UErrorCode &errorCode);328329/**330* Test if a string is in a given normalization form; same as the other version of isNormalized331* but takes an extra options parameter like most normalization functions.332*333* @param src String that is to be tested if it is in a normalization format.334* @param mode Which normalization form to test for.335* @param options the optional features to be enabled (0 for no options)336* @param errorCode ICU error code in/out parameter.337* Must fulfill U_SUCCESS before the function call.338* @return Boolean value indicating whether the source string is in the339* "mode" normalization form.340*341* @see quickCheck342* @deprecated ICU 56 Use Normalizer2 instead.343*/344static UBool345isNormalized(const UnicodeString &src, UNormalizationMode mode, int32_t options, UErrorCode &errorCode);346347/**348* Concatenate normalized strings, making sure that the result is normalized as well.349*350* If both the left and the right strings are in351* the normalization form according to "mode/options",352* then the result will be353*354* \code355* dest=normalize(left+right, mode, options)356* \endcode357*358* For details see unorm_concatenate in unorm.h.359*360* @param left Left source string.361* @param right Right source string.362* @param result The output string.363* @param mode The normalization mode.364* @param options A bit set of normalization options.365* @param errorCode ICU error code in/out parameter.366* Must fulfill U_SUCCESS before the function call.367* @return result368*369* @see unorm_concatenate370* @see normalize371* @see unorm_next372* @see unorm_previous373*374* @deprecated ICU 56 Use Normalizer2 instead.375*/376static UnicodeString &377U_EXPORT2 concatenate(const UnicodeString &left, const UnicodeString &right,378UnicodeString &result,379UNormalizationMode mode, int32_t options,380UErrorCode &errorCode);381#endif /* U_HIDE_DEPRECATED_API */382383/**384* Compare two strings for canonical equivalence.385* Further options include case-insensitive comparison and386* code point order (as opposed to code unit order).387*388* Canonical equivalence between two strings is defined as their normalized389* forms (NFD or NFC) being identical.390* This function compares strings incrementally instead of normalizing391* (and optionally case-folding) both strings entirely,392* improving performance significantly.393*394* Bulk normalization is only necessary if the strings do not fulfill the FCD395* conditions. Only in this case, and only if the strings are relatively long,396* is memory allocated temporarily.397* For FCD strings and short non-FCD strings there is no memory allocation.398*399* Semantically, this is equivalent to400* strcmp[CodePointOrder](NFD(foldCase(s1)), NFD(foldCase(s2)))401* where code point order and foldCase are all optional.402*403* UAX 21 2.5 Caseless Matching specifies that for a canonical caseless match404* the case folding must be performed first, then the normalization.405*406* @param s1 First source string.407* @param s2 Second source string.408*409* @param options A bit set of options:410* - U_FOLD_CASE_DEFAULT or 0 is used for default options:411* Case-sensitive comparison in code unit order, and the input strings412* are quick-checked for FCD.413*414* - UNORM_INPUT_IS_FCD415* Set if the caller knows that both s1 and s2 fulfill the FCD conditions.416* If not set, the function will quickCheck for FCD417* and normalize if necessary.418*419* - U_COMPARE_CODE_POINT_ORDER420* Set to choose code point order instead of code unit order421* (see u_strCompare for details).422*423* - U_COMPARE_IGNORE_CASE424* Set to compare strings case-insensitively using case folding,425* instead of case-sensitively.426* If set, then the following case folding options are used.427*428* - Options as used with case-insensitive comparisons, currently:429*430* - U_FOLD_CASE_EXCLUDE_SPECIAL_I431* (see u_strCaseCompare for details)432*433* - regular normalization options shifted left by UNORM_COMPARE_NORM_OPTIONS_SHIFT434*435* @param errorCode ICU error code in/out parameter.436* Must fulfill U_SUCCESS before the function call.437* @return <0 or 0 or >0 as usual for string comparisons438*439* @see unorm_compare440* @see normalize441* @see UNORM_FCD442* @see u_strCompare443* @see u_strCaseCompare444*445* @stable ICU 2.2446*/447static inline int32_t448compare(const UnicodeString &s1, const UnicodeString &s2,449uint32_t options,450UErrorCode &errorCode);451452#ifndef U_HIDE_DEPRECATED_API453//-------------------------------------------------------------------------454// Iteration API455//-------------------------------------------------------------------------456457/**458* Return the current character in the normalized text.459* current() may need to normalize some text at getIndex().460* The getIndex() is not changed.461*462* @return the current normalized code point463* @deprecated ICU 56 Use Normalizer2 instead.464*/465UChar32 current(void);466467/**468* Return the first character in the normalized text.469* This is equivalent to setIndexOnly(startIndex()) followed by next().470* (Post-increment semantics.)471*472* @return the first normalized code point473* @deprecated ICU 56 Use Normalizer2 instead.474*/475UChar32 first(void);476477/**478* Return the last character in the normalized text.479* This is equivalent to setIndexOnly(endIndex()) followed by previous().480* (Pre-decrement semantics.)481*482* @return the last normalized code point483* @deprecated ICU 56 Use Normalizer2 instead.484*/485UChar32 last(void);486487/**488* Return the next character in the normalized text.489* (Post-increment semantics.)490* If the end of the text has already been reached, DONE is returned.491* The DONE value could be confused with a U+FFFF non-character code point492* in the text. If this is possible, you can test getIndex()<endIndex()493* before calling next(), or (getIndex()<endIndex() || last()!=DONE)494* after calling next(). (Calling last() will change the iterator state!)495*496* The C API unorm_next() is more efficient and does not have this ambiguity.497*498* @return the next normalized code point499* @deprecated ICU 56 Use Normalizer2 instead.500*/501UChar32 next(void);502503/**504* Return the previous character in the normalized text and decrement.505* (Pre-decrement semantics.)506* If the beginning of the text has already been reached, DONE is returned.507* The DONE value could be confused with a U+FFFF non-character code point508* in the text. If this is possible, you can test509* (getIndex()>startIndex() || first()!=DONE). (Calling first() will change510* the iterator state!)511*512* The C API unorm_previous() is more efficient and does not have this ambiguity.513*514* @return the previous normalized code point515* @deprecated ICU 56 Use Normalizer2 instead.516*/517UChar32 previous(void);518519/**520* Set the iteration position in the input text that is being normalized,521* without any immediate normalization.522* After setIndexOnly(), getIndex() will return the same index that is523* specified here.524*525* @param index the desired index in the input text.526* @deprecated ICU 56 Use Normalizer2 instead.527*/528void setIndexOnly(int32_t index);529530/**531* Reset the index to the beginning of the text.532* This is equivalent to setIndexOnly(startIndex)).533* @deprecated ICU 56 Use Normalizer2 instead.534*/535void reset(void);536537/**538* Retrieve the current iteration position in the input text that is539* being normalized.540*541* A following call to next() will return a normalized code point from542* the input text at or after this index.543*544* After a call to previous(), getIndex() will point at or before the545* position in the input text where the normalized code point546* was returned from with previous().547*548* @return the current index in the input text549* @deprecated ICU 56 Use Normalizer2 instead.550*/551int32_t getIndex(void) const;552553/**554* Retrieve the index of the start of the input text. This is the begin index555* of the <code>CharacterIterator</code> or the start (i.e. index 0) of the string556* over which this <code>Normalizer</code> is iterating.557*558* @return the smallest index in the input text where the Normalizer operates559* @deprecated ICU 56 Use Normalizer2 instead.560*/561int32_t startIndex(void) const;562563/**564* Retrieve the index of the end of the input text. This is the end index565* of the <code>CharacterIterator</code> or the length of the string566* over which this <code>Normalizer</code> is iterating.567* This end index is exclusive, i.e., the Normalizer operates only on characters568* before this index.569*570* @return the first index in the input text where the Normalizer does not operate571* @deprecated ICU 56 Use Normalizer2 instead.572*/573int32_t endIndex(void) const;574575/**576* Returns TRUE when both iterators refer to the same character in the same577* input text.578*579* @param that a Normalizer object to compare this one to580* @return comparison result581* @deprecated ICU 56 Use Normalizer2 instead.582*/583UBool operator==(const Normalizer& that) const;584585/**586* Returns FALSE when both iterators refer to the same character in the same587* input text.588*589* @param that a Normalizer object to compare this one to590* @return comparison result591* @deprecated ICU 56 Use Normalizer2 instead.592*/593inline UBool operator!=(const Normalizer& that) const;594595/**596* Returns a pointer to a new Normalizer that is a clone of this one.597* The caller is responsible for deleting the new clone.598* @return a pointer to a new Normalizer599* @deprecated ICU 56 Use Normalizer2 instead.600*/601Normalizer* clone(void) const;602603/**604* Generates a hash code for this iterator.605*606* @return the hash code607* @deprecated ICU 56 Use Normalizer2 instead.608*/609int32_t hashCode(void) const;610611//-------------------------------------------------------------------------612// Property access methods613//-------------------------------------------------------------------------614615/**616* Set the normalization mode for this object.617* <p>618* <b>Note:</b>If the normalization mode is changed while iterating619* over a string, calls to {@link #next() } and {@link #previous() } may620* return previously buffers characters in the old normalization mode621* until the iteration is able to re-sync at the next base character.622* It is safest to call {@link #setIndexOnly }, {@link #reset() },623* {@link #setText }, {@link #first() },624* {@link #last() }, etc. after calling <code>setMode</code>.625* <p>626* @param newMode the new mode for this <code>Normalizer</code>.627* @see #getUMode628* @deprecated ICU 56 Use Normalizer2 instead.629*/630void setMode(UNormalizationMode newMode);631632/**633* Return the normalization mode for this object.634*635* This is an unusual name because there used to be a getMode() that636* returned a different type.637*638* @return the mode for this <code>Normalizer</code>639* @see #setMode640* @deprecated ICU 56 Use Normalizer2 instead.641*/642UNormalizationMode getUMode(void) const;643644/**645* Set options that affect this <code>Normalizer</code>'s operation.646* Options do not change the basic composition or decomposition operation647* that is being performed, but they control whether648* certain optional portions of the operation are done.649* Currently the only available option is obsolete.650*651* It is possible to specify multiple options that are all turned on or off.652*653* @param option the option(s) whose value is/are to be set.654* @param value the new setting for the option. Use <code>TRUE</code> to655* turn the option(s) on and <code>FALSE</code> to turn it/them off.656*657* @see #getOption658* @deprecated ICU 56 Use Normalizer2 instead.659*/660void setOption(int32_t option,661UBool value);662663/**664* Determine whether an option is turned on or off.665* If multiple options are specified, then the result is TRUE if any666* of them are set.667* <p>668* @param option the option(s) that are to be checked669* @return TRUE if any of the option(s) are set670* @see #setOption671* @deprecated ICU 56 Use Normalizer2 instead.672*/673UBool getOption(int32_t option) const;674675/**676* Set the input text over which this <code>Normalizer</code> will iterate.677* The iteration position is set to the beginning.678*679* @param newText a string that replaces the current input text680* @param status a UErrorCode681* @deprecated ICU 56 Use Normalizer2 instead.682*/683void setText(const UnicodeString& newText,684UErrorCode &status);685686/**687* Set the input text over which this <code>Normalizer</code> will iterate.688* The iteration position is set to the beginning.689*690* @param newText a CharacterIterator object that replaces the current input text691* @param status a UErrorCode692* @deprecated ICU 56 Use Normalizer2 instead.693*/694void setText(const CharacterIterator& newText,695UErrorCode &status);696697/**698* Set the input text over which this <code>Normalizer</code> will iterate.699* The iteration position is set to the beginning.700*701* @param newText a string that replaces the current input text702* @param length the length of the string, or -1 if NUL-terminated703* @param status a UErrorCode704* @deprecated ICU 56 Use Normalizer2 instead.705*/706void setText(ConstChar16Ptr newText,707int32_t length,708UErrorCode &status);709/**710* Copies the input text into the UnicodeString argument.711*712* @param result Receives a copy of the text under iteration.713* @deprecated ICU 56 Use Normalizer2 instead.714*/715void getText(UnicodeString& result);716717/**718* ICU "poor man's RTTI", returns a UClassID for this class.719* @returns a UClassID for this class.720* @deprecated ICU 56 Use Normalizer2 instead.721*/722static UClassID U_EXPORT2 getStaticClassID();723#endif /* U_HIDE_DEPRECATED_API */724725/**726* ICU "poor man's RTTI", returns a UClassID for the actual class.727* @return a UClassID for the actual class.728* @deprecated ICU 56 Use Normalizer2 instead.729*/730virtual UClassID getDynamicClassID() const;731732private:733//-------------------------------------------------------------------------734// Private functions735//-------------------------------------------------------------------------736737Normalizer(); // default constructor not implemented738Normalizer &operator=(const Normalizer &that); // assignment operator not implemented739740// Private utility methods for iteration741// For documentation, see the source code742UBool nextNormalize();743UBool previousNormalize();744745void init();746void clearBuffer(void);747748//-------------------------------------------------------------------------749// Private data750//-------------------------------------------------------------------------751752FilteredNormalizer2*fFilteredNorm2; // owned if not NULL753const Normalizer2 *fNorm2; // not owned; may be equal to fFilteredNorm2754UNormalizationMode fUMode; // deprecated755int32_t fOptions;756757// The input text and our position in it758CharacterIterator *text;759760// The normalization buffer is the result of normalization761// of the source in [currentIndex..nextIndex[ .762int32_t currentIndex, nextIndex;763764// A buffer for holding intermediate results765UnicodeString buffer;766int32_t bufferPos;767};768769//-------------------------------------------------------------------------770// Inline implementations771//-------------------------------------------------------------------------772773#ifndef U_HIDE_DEPRECATED_API774inline UBool775Normalizer::operator!= (const Normalizer& other) const776{ return ! operator==(other); }777778inline UNormalizationCheckResult779Normalizer::quickCheck(const UnicodeString& source,780UNormalizationMode mode,781UErrorCode &status) {782return quickCheck(source, mode, 0, status);783}784785inline UBool786Normalizer::isNormalized(const UnicodeString& source,787UNormalizationMode mode,788UErrorCode &status) {789return isNormalized(source, mode, 0, status);790}791#endif /* U_HIDE_DEPRECATED_API */792793inline int32_t794Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2,795uint32_t options,796UErrorCode &errorCode) {797// all argument checking is done in unorm_compare798return unorm_compare(toUCharPtr(s1.getBuffer()), s1.length(),799toUCharPtr(s2.getBuffer()), s2.length(),800options,801&errorCode);802}803804U_NAMESPACE_END805806#endif /* #if !UCONFIG_NO_NORMALIZATION */807808#endif // NORMLZR_H809810811