ICU 72.1 72.1
unorm.h
Go to the documentation of this file.
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/*
4*******************************************************************************
5* Copyright (c) 1996-2016, International Business Machines Corporation
6* and others. All Rights Reserved.
7*******************************************************************************
8* File unorm.h
9*
10* Created by: Vladimir Weinstein 12052000
11*
12* Modification history :
13*
14* Date Name Description
15* 02/01/01 synwee Added normalization quickcheck enum and method.
16*/
17#ifndef UNORM_H
18#define UNORM_H
19
20#include "unicode/utypes.h"
21
22#if !UCONFIG_NO_NORMALIZATION
23
24#include "unicode/uiter.h"
25#include "unicode/unorm2.h"
26
132// Do not conditionalize the following enum with #ifndef U_HIDE_DEPRECATED_API,
133// it is needed for layout of Normalizer object.
134#ifndef U_FORCE_HIDE_DEPRECATED_API
135
140typedef enum {
155
159
160#endif // U_FORCE_HIDE_DEPRECATED_API
161
162#ifndef U_HIDE_DEPRECATED_API
163
171enum {
180
196#define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
197
217U_DEPRECATED int32_t U_EXPORT2
218unorm_normalize(const UChar *source, int32_t sourceLength,
219 UNormalizationMode mode, int32_t options,
220 UChar *result, int32_t resultLength,
221 UErrorCode *status);
222
244unorm_quickCheck(const UChar *source, int32_t sourcelength,
246 UErrorCode *status);
247
265unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
266 UNormalizationMode mode, int32_t options,
267 UErrorCode *pErrorCode);
268
290U_DEPRECATED UBool U_EXPORT2
291unorm_isNormalized(const UChar *src, int32_t srcLength,
293 UErrorCode *pErrorCode);
294
312U_DEPRECATED UBool U_EXPORT2
313unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
314 UNormalizationMode mode, int32_t options,
315 UErrorCode *pErrorCode);
316
390U_DEPRECATED int32_t U_EXPORT2
392 UChar *dest, int32_t destCapacity,
393 UNormalizationMode mode, int32_t options,
394 UBool doNormalize, UBool *pNeededToNormalize,
395 UErrorCode *pErrorCode);
396
423U_DEPRECATED int32_t U_EXPORT2
425 UChar *dest, int32_t destCapacity,
426 UNormalizationMode mode, int32_t options,
427 UBool doNormalize, UBool *pNeededToNormalize,
428 UErrorCode *pErrorCode);
429
467U_DEPRECATED int32_t U_EXPORT2
468unorm_concatenate(const UChar *left, int32_t leftLength,
469 const UChar *right, int32_t rightLength,
470 UChar *dest, int32_t destCapacity,
471 UNormalizationMode mode, int32_t options,
472 UErrorCode *pErrorCode);
473
474#endif /* U_HIDE_DEPRECATED_API */
475#endif /* #if !UCONFIG_NO_NORMALIZATION */
476#endif
C API for code unit iteration.
Definition: uiter.h:341
C API: Unicode Character Iteration.
#define U_DEPRECATED
This is used to declare a function as a deprecated public ICU C API
Definition: umachine.h:116
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:412
C API: New API for Unicode Normalization.
UNormalizationCheckResult
Result values for normalization quick check functions.
Definition: unorm2.h:97
@ UNORM_UNICODE_3_2
Options bit set value to select Unicode 3.2 normalization (except NormalizationCorrections).
Definition: unorm.h:178
UBool unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode)
Test if a string is in a given normalization form; same as unorm_isNormalized but takes an extra opti...
int32_t unorm_previous(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UBool doNormalize, UBool *pNeededToNormalize, UErrorCode *pErrorCode)
Iterative normalization backward.
int32_t unorm_normalize(const UChar *source, int32_t sourceLength, UNormalizationMode mode, int32_t options, UChar *result, int32_t resultLength, UErrorCode *status)
Normalize a string.
UBool unorm_isNormalized(const UChar *src, int32_t srcLength, UNormalizationMode mode, UErrorCode *pErrorCode)
Test if a string is in a given normalization form.
int32_t unorm_concatenate(const UChar *left, int32_t leftLength, const UChar *right, int32_t rightLength, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode)
Concatenate normalized strings, making sure that the result is normalized as well.
int32_t unorm_next(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UBool doNormalize, UBool *pNeededToNormalize, UErrorCode *pErrorCode)
Iterative normalization forward.
UNormalizationCheckResult unorm_quickCheck(const UChar *source, int32_t sourcelength, UNormalizationMode mode, UErrorCode *status)
Performing quick check on a string, to quickly determine if the string is in a particular normalizati...
UNormalizationCheckResult unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode)
Performing quick check on a string; same as unorm_quickCheck but takes an extra options parameter lik...
UNormalizationMode
Constants for normalization modes.
Definition: unorm.h:140
@ UNORM_DEFAULT
Default normalization.
Definition: unorm.h:150
@ UNORM_NONE
No decomposition/composition.
Definition: unorm.h:142
@ UNORM_NFKD
Compatibility decomposition.
Definition: unorm.h:146
@ UNORM_NFC
Canonical decomposition followed by canonical composition.
Definition: unorm.h:148
@ UNORM_NFD
Canonical decomposition.
Definition: unorm.h:144
@ UNORM_NFKC
Compatibility decomposition followed by canonical composition.
Definition: unorm.h:152
@ UNORM_FCD
"Fast C or D" form.
Definition: unorm.h:154
@ UNORM_MODE_COUNT
One more than the highest normalization mode constant.
Definition: unorm.h:157
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415