Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/common/unicode/normlzr.h
38827 views
/*1********************************************************************2* COPYRIGHT:3* Copyright (c) 1996-2015, International Business Machines Corporation and4* others. All Rights Reserved.5********************************************************************6*/78#ifndef NORMLZR_H9#define NORMLZR_H1011#include "unicode/utypes.h"1213/**14* \file15* \brief C++ API: Unicode Normalization16*/1718#if !UCONFIG_NO_NORMALIZATION1920#include "unicode/chariter.h"21#include "unicode/normalizer2.h"22#include "unicode/unistr.h"23#include "unicode/unorm.h"24#include "unicode/uobject.h"2526U_NAMESPACE_BEGIN27/**28* Old Unicode normalization API.29*30* This API has been replaced by the Normalizer2 class and is only available31* for backward compatibility. This class simply delegates to the Normalizer2 class.32* There is one exception: The new API does not provide a replacement for Normalizer::compare().33*34* The Normalizer class supports the standard normalization forms described in35* <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">36* Unicode Standard Annex #15: Unicode Normalization Forms</a>.37*38* The Normalizer class consists of two parts:39* - static functions that normalize strings or test if strings are normalized40* - a Normalizer object is an iterator that takes any kind of text and41* provides iteration over its normalized form42*43* The Normalizer class is not suitable for subclassing.44*45* For basic information about normalization forms and details about the C API46* please see the documentation in unorm.h.47*48* The iterator API with the Normalizer constructors and the non-static functions49* use a CharacterIterator as input. It is possible to pass a string which50* is then internally wrapped in a CharacterIterator.51* The input text is not normalized all at once, but incrementally where needed52* (providing efficient random access).53* This allows to pass in a large text but spend only a small amount of time54* normalizing a small part of that text.55* However, if the entire text is normalized, then the iterator will be56* slower than normalizing the entire text at once and iterating over the result.57* A possible use of the Normalizer iterator is also to report an index into the58* original text that is close to where the normalized characters come from.59*60* <em>Important:</em> The iterator API was cleaned up significantly for ICU 2.0.61* The earlier implementation reported the getIndex() inconsistently,62* and previous() could not be used after setIndex(), next(), first(), and current().63*64* Normalizer allows to start normalizing from anywhere in the input text by65* calling setIndexOnly(), first(), or last().66* Without calling any of these, the iterator will start at the beginning of the text.67*68* At any time, next() returns the next normalized code point (UChar32),69* with post-increment semantics (like CharacterIterator::next32PostInc()).70* previous() returns the previous normalized code point (UChar32),71* with pre-decrement semantics (like CharacterIterator::previous32()).72*73* current() returns the current code point74* (respectively the one at the newly set index) without moving75* the getIndex(). Note that if the text at the current position76* needs to be normalized, then these functions will do that.77* (This is why current() is not const.)78* It is more efficient to call setIndexOnly() instead, which does not79* normalize.80*81* getIndex() always refers to the position in the input text where the normalized82* code points are returned from. It does not always change with each returned83* code point.84* The code point that is returned from any of the functions85* corresponds to text at or after getIndex(), according to the86* function's iteration semantics (post-increment or pre-decrement).87*88* next() returns a code point from at or after the getIndex()89* from before the next() call. After the next() call, the getIndex()90* might have moved to where the next code point will be returned from91* (from a next() or current() call).92* This is semantically equivalent to array access with array[index++]93* (post-increment semantics).94*95* previous() returns a code point from at or after the getIndex()96* from after the previous() call.97* This is semantically equivalent to array access with array[--index]98* (pre-decrement semantics).99*100* Internally, the Normalizer iterator normalizes a small piece of text101* starting at the getIndex() and ending at a following "safe" index.102* The normalized results is stored in an internal string buffer, and103* the code points are iterated from there.104* With multiple iteration calls, this is repeated until the next piece105* of text needs to be normalized, and the getIndex() needs to be moved.106*107* The following "safe" index, the internal buffer, and the secondary108* iteration index into that buffer are not exposed on the API.109* This also means that it is currently not practical to return to110* a particular, arbitrary position in the text because one would need to111* know, and be able to set, in addition to the getIndex(), at least also the112* current index into the internal buffer.113* It is currently only possible to observe when getIndex() changes114* (with careful consideration of the iteration semantics),115* at which time the internal index will be 0.116* For example, if getIndex() is different after next() than before it,117* then the internal index is 0 and one can return to this getIndex()118* later with setIndexOnly().119*120* Note: While the setIndex() and getIndex() refer to indices in the121* underlying Unicode input text, the next() and previous() methods122* iterate through characters in the normalized output.123* This means that there is not necessarily a one-to-one correspondence124* between characters returned by next() and previous() and the indices125* passed to and returned from setIndex() and getIndex().126* It is for this reason that Normalizer does not implement the CharacterIterator interface.127*128* @author Laura Werner, Mark Davis, Markus Scherer129* @stable ICU 2.0130*/131class U_COMMON_API Normalizer : public UObject {132public:133#ifndef U_HIDE_DEPRECATED_API134/**135* If DONE is returned from an iteration function that returns a code point,136* then there are no more normalization results available.137* @deprecated ICU 56 Use Normalizer2 instead.138*/139enum {140DONE=0xffff141};142143// Constructors144145/**146* Creates a new <code>Normalizer</code> object for iterating over the147* normalized form of a given string.148* <p>149* @param str The string to be normalized. The normalization150* will start at the beginning of the string.151*152* @param mode The normalization mode.153* @deprecated ICU 56 Use Normalizer2 instead.154*/155Normalizer(const UnicodeString& str, UNormalizationMode mode);156157/**158* Creates a new <code>Normalizer</code> object for iterating over the159* normalized form of a given string.160* <p>161* @param str The string to be normalized. The normalization162* will start at the beginning of the string.163*164* @param length Length of the string, or -1 if NUL-terminated.165* @param mode The normalization mode.166* @deprecated ICU 56 Use Normalizer2 instead.167*/168Normalizer(const UChar* str, int32_t length, UNormalizationMode mode);169170/**171* Creates a new <code>Normalizer</code> object for iterating over the172* normalized form of the given text.173* <p>174* @param iter The input text to be normalized. The normalization175* will start at the beginning of the string.176*177* @param mode The normalization mode.178* @deprecated ICU 56 Use Normalizer2 instead.179*/180Normalizer(const CharacterIterator& iter, UNormalizationMode mode);181182/**183* Copy constructor.184* @param copy The object to be copied.185* @deprecated ICU 56 Use Normalizer2 instead.186*/187Normalizer(const Normalizer& copy);188#endif /* U_HIDE_DEPRECATED_API */189190/**191* Destructor192* @deprecated ICU 56 Use Normalizer2 instead.193*/194virtual ~Normalizer();195196197//-------------------------------------------------------------------------198// Static utility methods199//-------------------------------------------------------------------------200201#ifndef U_HIDE_DEPRECATED_API202/**203* Normalizes a <code>UnicodeString</code> according to the specified normalization mode.204* This is a wrapper for unorm_normalize(), using UnicodeString's.205*206* The <code>options</code> parameter specifies which optional207* <code>Normalizer</code> features are to be enabled for this operation.208*209* @param source the input string to be normalized.210* @param mode the normalization mode211* @param options the optional features to be enabled (0 for no options)212* @param result The normalized string (on output).213* @param status The error code.214* @deprecated ICU 56 Use Normalizer2 instead.215*/216static void U_EXPORT2 normalize(const UnicodeString& source,217UNormalizationMode mode, int32_t options,218UnicodeString& result,219UErrorCode &status);220221/**222* Compose a <code>UnicodeString</code>.223* This is equivalent to normalize() with mode UNORM_NFC or UNORM_NFKC.224* This is a wrapper for unorm_normalize(), using UnicodeString's.225*226* The <code>options</code> parameter specifies which optional227* <code>Normalizer</code> features are to be enabled for this operation.228*229* @param source the string to be composed.230* @param compat Perform compatibility decomposition before composition.231* If this argument is <code>FALSE</code>, only canonical232* decomposition will be performed.233* @param options the optional features to be enabled (0 for no options)234* @param result The composed string (on output).235* @param status The error code.236* @deprecated ICU 56 Use Normalizer2 instead.237*/238static void U_EXPORT2 compose(const UnicodeString& source,239UBool compat, int32_t options,240UnicodeString& result,241UErrorCode &status);242243/**244* Static method to decompose a <code>UnicodeString</code>.245* This is equivalent to normalize() with mode UNORM_NFD or UNORM_NFKD.246* This is a wrapper for unorm_normalize(), using UnicodeString's.247*248* The <code>options</code> parameter specifies which optional249* <code>Normalizer</code> features are to be enabled for this operation.250*251* @param source the string to be decomposed.252* @param compat Perform compatibility decomposition.253* If this argument is <code>FALSE</code>, only canonical254* decomposition will be performed.255* @param options the optional features to be enabled (0 for no options)256* @param result The decomposed string (on output).257* @param status The error code.258* @deprecated ICU 56 Use Normalizer2 instead.259*/260static void U_EXPORT2 decompose(const UnicodeString& source,261UBool compat, int32_t options,262UnicodeString& result,263UErrorCode &status);264265/**266* Performing quick check on a string, to quickly determine if the string is267* in a particular normalization format.268* This is a wrapper for unorm_quickCheck(), using a UnicodeString.269*270* Three types of result can be returned UNORM_YES, UNORM_NO or271* UNORM_MAYBE. Result UNORM_YES indicates that the argument272* string is in the desired normalized format, UNORM_NO determines that273* argument string is not in the desired normalized format. A274* UNORM_MAYBE result indicates that a more thorough check is required,275* the user may have to put the string in its normalized form and compare the276* results.277* @param source string for determining if it is in a normalized format278* @param mode normalization format279* @param status A reference to a UErrorCode to receive any errors280* @return UNORM_YES, UNORM_NO or UNORM_MAYBE281*282* @see isNormalized283* @deprecated ICU 56 Use Normalizer2 instead.284*/285static inline UNormalizationCheckResult286quickCheck(const UnicodeString &source, UNormalizationMode mode, UErrorCode &status);287288/**289* Performing quick check on a string; same as the other version of quickCheck290* but takes an extra options parameter like most normalization functions.291*292* @param source string for determining if it is in a normalized format293* @param mode normalization format294* @param options the optional features to be enabled (0 for no options)295* @param status A reference to a UErrorCode to receive any errors296* @return UNORM_YES, UNORM_NO or UNORM_MAYBE297*298* @see isNormalized299* @deprecated ICU 56 Use Normalizer2 instead.300*/301static UNormalizationCheckResult302quickCheck(const UnicodeString &source, UNormalizationMode mode, int32_t options, UErrorCode &status);303304/**305* Test if a string is in a given normalization form.306* This is semantically equivalent to source.equals(normalize(source, mode)) .307*308* Unlike unorm_quickCheck(), this function returns a definitive result,309* never a "maybe".310* For NFD, NFKD, and FCD, both functions work exactly the same.311* For NFC and NFKC where quickCheck may return "maybe", this function will312* perform further tests to arrive at a TRUE/FALSE result.313*314* @param src String that is to be tested if it is in a normalization format.315* @param mode Which normalization form to test for.316* @param errorCode ICU error code in/out parameter.317* Must fulfill U_SUCCESS before the function call.318* @return Boolean value indicating whether the source string is in the319* "mode" normalization form.320*321* @see quickCheck322* @deprecated ICU 56 Use Normalizer2 instead.323*/324static inline UBool325isNormalized(const UnicodeString &src, UNormalizationMode mode, UErrorCode &errorCode);326327/**328* Test if a string is in a given normalization form; same as the other version of isNormalized329* but takes an extra options parameter like most normalization functions.330*331* @param src String that is to be tested if it is in a normalization format.332* @param mode Which normalization form to test for.333* @param options the optional features to be enabled (0 for no options)334* @param errorCode ICU error code in/out parameter.335* Must fulfill U_SUCCESS before the function call.336* @return Boolean value indicating whether the source string is in the337* "mode" normalization form.338*339* @see quickCheck340* @deprecated ICU 56 Use Normalizer2 instead.341*/342static UBool343isNormalized(const UnicodeString &src, UNormalizationMode mode, int32_t options, UErrorCode &errorCode);344345/**346* Concatenate normalized strings, making sure that the result is normalized as well.347*348* If both the left and the right strings are in349* the normalization form according to "mode/options",350* then the result will be351*352* \code353* dest=normalize(left+right, mode, options)354* \endcode355*356* For details see unorm_concatenate in unorm.h.357*358* @param left Left source string.359* @param right Right source string.360* @param result The output string.361* @param mode The normalization mode.362* @param options A bit set of normalization options.363* @param errorCode ICU error code in/out parameter.364* Must fulfill U_SUCCESS before the function call.365* @return result366*367* @see unorm_concatenate368* @see normalize369* @see unorm_next370* @see unorm_previous371*372* @deprecated ICU 56 Use Normalizer2 instead.373*/374static UnicodeString &375U_EXPORT2 concatenate(const UnicodeString &left, const UnicodeString &right,376UnicodeString &result,377UNormalizationMode mode, int32_t options,378UErrorCode &errorCode);379#endif /* U_HIDE_DEPRECATED_API */380381/**382* Compare two strings for canonical equivalence.383* Further options include case-insensitive comparison and384* code point order (as opposed to code unit order).385*386* Canonical equivalence between two strings is defined as their normalized387* forms (NFD or NFC) being identical.388* This function compares strings incrementally instead of normalizing389* (and optionally case-folding) both strings entirely,390* improving performance significantly.391*392* Bulk normalization is only necessary if the strings do not fulfill the FCD393* conditions. Only in this case, and only if the strings are relatively long,394* is memory allocated temporarily.395* For FCD strings and short non-FCD strings there is no memory allocation.396*397* Semantically, this is equivalent to398* strcmp[CodePointOrder](NFD(foldCase(s1)), NFD(foldCase(s2)))399* where code point order and foldCase are all optional.400*401* UAX 21 2.5 Caseless Matching specifies that for a canonical caseless match402* the case folding must be performed first, then the normalization.403*404* @param s1 First source string.405* @param s2 Second source string.406*407* @param options A bit set of options:408* - U_FOLD_CASE_DEFAULT or 0 is used for default options:409* Case-sensitive comparison in code unit order, and the input strings410* are quick-checked for FCD.411*412* - UNORM_INPUT_IS_FCD413* Set if the caller knows that both s1 and s2 fulfill the FCD conditions.414* If not set, the function will quickCheck for FCD415* and normalize if necessary.416*417* - U_COMPARE_CODE_POINT_ORDER418* Set to choose code point order instead of code unit order419* (see u_strCompare for details).420*421* - U_COMPARE_IGNORE_CASE422* Set to compare strings case-insensitively using case folding,423* instead of case-sensitively.424* If set, then the following case folding options are used.425*426* - Options as used with case-insensitive comparisons, currently:427*428* - U_FOLD_CASE_EXCLUDE_SPECIAL_I429* (see u_strCaseCompare for details)430*431* - regular normalization options shifted left by UNORM_COMPARE_NORM_OPTIONS_SHIFT432*433* @param errorCode ICU error code in/out parameter.434* Must fulfill U_SUCCESS before the function call.435* @return <0 or 0 or >0 as usual for string comparisons436*437* @see unorm_compare438* @see normalize439* @see UNORM_FCD440* @see u_strCompare441* @see u_strCaseCompare442*443* @stable ICU 2.2444*/445static inline int32_t446compare(const UnicodeString &s1, const UnicodeString &s2,447uint32_t options,448UErrorCode &errorCode);449450#ifndef U_HIDE_DEPRECATED_API451//-------------------------------------------------------------------------452// Iteration API453//-------------------------------------------------------------------------454455/**456* Return the current character in the normalized text.457* current() may need to normalize some text at getIndex().458* The getIndex() is not changed.459*460* @return the current normalized code point461* @deprecated ICU 56 Use Normalizer2 instead.462*/463UChar32 current(void);464465/**466* Return the first character in the normalized text.467* This is equivalent to setIndexOnly(startIndex()) followed by next().468* (Post-increment semantics.)469*470* @return the first normalized code point471* @deprecated ICU 56 Use Normalizer2 instead.472*/473UChar32 first(void);474475/**476* Return the last character in the normalized text.477* This is equivalent to setIndexOnly(endIndex()) followed by previous().478* (Pre-decrement semantics.)479*480* @return the last normalized code point481* @deprecated ICU 56 Use Normalizer2 instead.482*/483UChar32 last(void);484485/**486* Return the next character in the normalized text.487* (Post-increment semantics.)488* If the end of the text has already been reached, DONE is returned.489* The DONE value could be confused with a U+FFFF non-character code point490* in the text. If this is possible, you can test getIndex()<endIndex()491* before calling next(), or (getIndex()<endIndex() || last()!=DONE)492* after calling next(). (Calling last() will change the iterator state!)493*494* The C API unorm_next() is more efficient and does not have this ambiguity.495*496* @return the next normalized code point497* @deprecated ICU 56 Use Normalizer2 instead.498*/499UChar32 next(void);500501/**502* Return the previous character in the normalized text and decrement.503* (Pre-decrement semantics.)504* If the beginning of the text has already been reached, DONE is returned.505* The DONE value could be confused with a U+FFFF non-character code point506* in the text. If this is possible, you can test507* (getIndex()>startIndex() || first()!=DONE). (Calling first() will change508* the iterator state!)509*510* The C API unorm_previous() is more efficient and does not have this ambiguity.511*512* @return the previous normalized code point513* @deprecated ICU 56 Use Normalizer2 instead.514*/515UChar32 previous(void);516517/**518* Set the iteration position in the input text that is being normalized,519* without any immediate normalization.520* After setIndexOnly(), getIndex() will return the same index that is521* specified here.522*523* @param index the desired index in the input text.524* @deprecated ICU 56 Use Normalizer2 instead.525*/526void setIndexOnly(int32_t index);527528/**529* Reset the index to the beginning of the text.530* This is equivalent to setIndexOnly(startIndex)).531* @deprecated ICU 56 Use Normalizer2 instead.532*/533void reset(void);534535/**536* Retrieve the current iteration position in the input text that is537* being normalized.538*539* A following call to next() will return a normalized code point from540* the input text at or after this index.541*542* After a call to previous(), getIndex() will point at or before the543* position in the input text where the normalized code point544* was returned from with previous().545*546* @return the current index in the input text547* @deprecated ICU 56 Use Normalizer2 instead.548*/549int32_t getIndex(void) const;550551/**552* Retrieve the index of the start of the input text. This is the begin index553* of the <code>CharacterIterator</code> or the start (i.e. index 0) of the string554* over which this <code>Normalizer</code> is iterating.555*556* @return the smallest index in the input text where the Normalizer operates557* @deprecated ICU 56 Use Normalizer2 instead.558*/559int32_t startIndex(void) const;560561/**562* Retrieve the index of the end of the input text. This is the end index563* of the <code>CharacterIterator</code> or the length of the string564* over which this <code>Normalizer</code> is iterating.565* This end index is exclusive, i.e., the Normalizer operates only on characters566* before this index.567*568* @return the first index in the input text where the Normalizer does not operate569* @deprecated ICU 56 Use Normalizer2 instead.570*/571int32_t endIndex(void) const;572573/**574* Returns TRUE when both iterators refer to the same character in the same575* input text.576*577* @param that a Normalizer object to compare this one to578* @return comparison result579* @deprecated ICU 56 Use Normalizer2 instead.580*/581UBool operator==(const Normalizer& that) const;582583/**584* Returns FALSE when both iterators refer to the same character in the same585* input text.586*587* @param that a Normalizer object to compare this one to588* @return comparison result589* @deprecated ICU 56 Use Normalizer2 instead.590*/591inline UBool operator!=(const Normalizer& that) const;592593/**594* Returns a pointer to a new Normalizer that is a clone of this one.595* The caller is responsible for deleting the new clone.596* @return a pointer to a new Normalizer597* @deprecated ICU 56 Use Normalizer2 instead.598*/599Normalizer* clone(void) const;600601/**602* Generates a hash code for this iterator.603*604* @return the hash code605* @deprecated ICU 56 Use Normalizer2 instead.606*/607int32_t hashCode(void) const;608609//-------------------------------------------------------------------------610// Property access methods611//-------------------------------------------------------------------------612613/**614* Set the normalization mode for this object.615* <p>616* <b>Note:</b>If the normalization mode is changed while iterating617* over a string, calls to {@link #next() } and {@link #previous() } may618* return previously buffers characters in the old normalization mode619* until the iteration is able to re-sync at the next base character.620* It is safest to call {@link #setIndexOnly }, {@link #reset() },621* {@link #setText }, {@link #first() },622* {@link #last() }, etc. after calling <code>setMode</code>.623* <p>624* @param newMode the new mode for this <code>Normalizer</code>.625* @see #getUMode626* @deprecated ICU 56 Use Normalizer2 instead.627*/628void setMode(UNormalizationMode newMode);629630/**631* Return the normalization mode for this object.632*633* This is an unusual name because there used to be a getMode() that634* returned a different type.635*636* @return the mode for this <code>Normalizer</code>637* @see #setMode638* @deprecated ICU 56 Use Normalizer2 instead.639*/640UNormalizationMode getUMode(void) const;641642/**643* Set options that affect this <code>Normalizer</code>'s operation.644* Options do not change the basic composition or decomposition operation645* that is being performed, but they control whether646* certain optional portions of the operation are done.647* Currently the only available option is obsolete.648*649* It is possible to specify multiple options that are all turned on or off.650*651* @param option the option(s) whose value is/are to be set.652* @param value the new setting for the option. Use <code>TRUE</code> to653* turn the option(s) on and <code>FALSE</code> to turn it/them off.654*655* @see #getOption656* @deprecated ICU 56 Use Normalizer2 instead.657*/658void setOption(int32_t option,659UBool value);660661/**662* Determine whether an option is turned on or off.663* If multiple options are specified, then the result is TRUE if any664* of them are set.665* <p>666* @param option the option(s) that are to be checked667* @return TRUE if any of the option(s) are set668* @see #setOption669* @deprecated ICU 56 Use Normalizer2 instead.670*/671UBool getOption(int32_t option) const;672673/**674* Set the input text over which this <code>Normalizer</code> will iterate.675* The iteration position is set to the beginning.676*677* @param newText a string that replaces the current input text678* @param status a UErrorCode679* @deprecated ICU 56 Use Normalizer2 instead.680*/681void setText(const UnicodeString& newText,682UErrorCode &status);683684/**685* Set the input text over which this <code>Normalizer</code> will iterate.686* The iteration position is set to the beginning.687*688* @param newText a CharacterIterator object that replaces the current input text689* @param status a UErrorCode690* @deprecated ICU 56 Use Normalizer2 instead.691*/692void setText(const CharacterIterator& newText,693UErrorCode &status);694695/**696* Set the input text over which this <code>Normalizer</code> will iterate.697* The iteration position is set to the beginning.698*699* @param newText a string that replaces the current input text700* @param length the length of the string, or -1 if NUL-terminated701* @param status a UErrorCode702* @deprecated ICU 56 Use Normalizer2 instead.703*/704void setText(const UChar* newText,705int32_t length,706UErrorCode &status);707/**708* Copies the input text into the UnicodeString argument.709*710* @param result Receives a copy of the text under iteration.711* @deprecated ICU 56 Use Normalizer2 instead.712*/713void getText(UnicodeString& result);714715/**716* ICU "poor man's RTTI", returns a UClassID for this class.717* @returns a UClassID for this class.718* @deprecated ICU 56 Use Normalizer2 instead.719*/720static UClassID U_EXPORT2 getStaticClassID();721#endif /* U_HIDE_DEPRECATED_API */722723/**724* ICU "poor man's RTTI", returns a UClassID for the actual class.725* @return a UClassID for the actual class.726* @deprecated ICU 56 Use Normalizer2 instead.727*/728virtual UClassID getDynamicClassID() const;729730private:731//-------------------------------------------------------------------------732// Private functions733//-------------------------------------------------------------------------734735Normalizer(); // default constructor not implemented736Normalizer &operator=(const Normalizer &that); // assignment operator not implemented737738// Private utility methods for iteration739// For documentation, see the source code740UBool nextNormalize();741UBool previousNormalize();742743void init();744void clearBuffer(void);745746//-------------------------------------------------------------------------747// Private data748//-------------------------------------------------------------------------749750FilteredNormalizer2*fFilteredNorm2; // owned if not NULL751const Normalizer2 *fNorm2; // not owned; may be equal to fFilteredNorm2752#ifndef U_HIDE_DEPRECATED_API753UNormalizationMode fUMode;754#endif /* U_HIDE_DEPRECATED_API */755int32_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(s1.getBuffer(), s1.length(),799s2.getBuffer(), s2.length(),800options,801&errorCode);802}803804U_NAMESPACE_END805806#endif /* #if !UCONFIG_NO_NORMALIZATION */807808#endif // NORMLZR_H809810811