ICU 57.1 57.1
unorm.h
Go to the documentation of this file.
1/*
2*******************************************************************************
3* Copyright (c) 1996-2016, International Business Machines Corporation
4* and others. All Rights Reserved.
5*******************************************************************************
6* File unorm.h
7*
8* Created by: Vladimir Weinstein 12052000
9*
10* Modification history :
11*
12* Date Name Description
13* 02/01/01 synwee Added normalization quickcheck enum and method.
14*/
15#ifndef UNORM_H
16#define UNORM_H
17
18#include "unicode/utypes.h"
19
20#if !UCONFIG_NO_NORMALIZATION
21
22#include "unicode/uiter.h"
23#include "unicode/unorm2.h"
24
25#ifndef U_HIDE_DEPRECATED_API
26
131
155
163enum {
171};
172
188#define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
189
209U_STABLE int32_t U_EXPORT2
210unorm_normalize(const UChar *source, int32_t sourceLength,
211 UNormalizationMode mode, int32_t options,
212 UChar *result, int32_t resultLength,
213 UErrorCode *status);
214
236unorm_quickCheck(const UChar *source, int32_t sourcelength,
238 UErrorCode *status);
239
257unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
258 UNormalizationMode mode, int32_t options,
259 UErrorCode *pErrorCode);
260
282U_STABLE UBool U_EXPORT2
283unorm_isNormalized(const UChar *src, int32_t srcLength,
285 UErrorCode *pErrorCode);
286
304U_STABLE UBool U_EXPORT2
305unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
306 UNormalizationMode mode, int32_t options,
307 UErrorCode *pErrorCode);
308
382U_STABLE int32_t U_EXPORT2
384 UChar *dest, int32_t destCapacity,
385 UNormalizationMode mode, int32_t options,
386 UBool doNormalize, UBool *pNeededToNormalize,
387 UErrorCode *pErrorCode);
388
415U_STABLE int32_t U_EXPORT2
417 UChar *dest, int32_t destCapacity,
418 UNormalizationMode mode, int32_t options,
419 UBool doNormalize, UBool *pNeededToNormalize,
420 UErrorCode *pErrorCode);
421
459U_STABLE int32_t U_EXPORT2
460unorm_concatenate(const UChar *left, int32_t leftLength,
461 const UChar *right, int32_t rightLength,
462 UChar *dest, int32_t destCapacity,
463 UNormalizationMode mode, int32_t options,
464 UErrorCode *pErrorCode);
465
466#endif /* U_HIDE_DEPRECATED_API */
467#endif /* #if !UCONFIG_NO_NORMALIZATION */
468#endif
C API for code unit iteration.
Definition uiter.h:339
C API: Unicode Character Iteration.
int8_t UBool
The ICU boolean type.
Definition umachine.h:234
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition umachine.h:312
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition umachine.h:109
C API: New API for Unicode Normalization.
UNormalizationCheckResult
Result values for normalization quick check functions.
Definition unorm2.h:91
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.
@ UNORM_UNICODE_3_2
Options bit set value to select Unicode 3.2 normalization (except NormalizationCorrections).
Definition unorm.h:170
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:136
@ UNORM_DEFAULT
Default normalization.
Definition unorm.h:146
@ UNORM_NONE
No decomposition/composition.
Definition unorm.h:138
@ UNORM_NFKD
Compatibility decomposition.
Definition unorm.h:142
@ UNORM_NFC
Canonical decomposition followed by canonical composition.
Definition unorm.h:144
@ UNORM_NFD
Canonical decomposition.
Definition unorm.h:140
@ UNORM_NFKC
Compatibility decomposition followed by canonical composition.
Definition unorm.h:148
@ UNORM_FCD
"Fast C or D" form.
Definition unorm.h:150
@ UNORM_MODE_COUNT
One more than the highest normalization mode constant.
Definition unorm.h:153
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:476