ICU 50.2 50.2
unorm.h
Go to the documentation of this file.
1/*
2*******************************************************************************
3* Copyright (c) 1996-2010, 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
128
152
160enum {
168};
169
185#define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
186
206U_STABLE int32_t U_EXPORT2
207unorm_normalize(const UChar *source, int32_t sourceLength,
208 UNormalizationMode mode, int32_t options,
209 UChar *result, int32_t resultLength,
210 UErrorCode *status);
211
233unorm_quickCheck(const UChar *source, int32_t sourcelength,
235 UErrorCode *status);
236
254unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
255 UNormalizationMode mode, int32_t options,
256 UErrorCode *pErrorCode);
257
279U_STABLE UBool U_EXPORT2
280unorm_isNormalized(const UChar *src, int32_t srcLength,
282 UErrorCode *pErrorCode);
283
301U_STABLE UBool U_EXPORT2
302unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
303 UNormalizationMode mode, int32_t options,
304 UErrorCode *pErrorCode);
305
379U_STABLE int32_t U_EXPORT2
381 UChar *dest, int32_t destCapacity,
382 UNormalizationMode mode, int32_t options,
383 UBool doNormalize, UBool *pNeededToNormalize,
384 UErrorCode *pErrorCode);
385
412U_STABLE int32_t U_EXPORT2
414 UChar *dest, int32_t destCapacity,
415 UNormalizationMode mode, int32_t options,
416 UBool doNormalize, UBool *pNeededToNormalize,
417 UErrorCode *pErrorCode);
418
456U_STABLE int32_t U_EXPORT2
457unorm_concatenate(const UChar *left, int32_t leftLength,
458 const UChar *right, int32_t rightLength,
459 UChar *dest, int32_t destCapacity,
460 UNormalizationMode mode, int32_t options,
461 UErrorCode *pErrorCode);
462
468#define UNORM_INPUT_IS_FCD 0x20000
469
475#define U_COMPARE_IGNORE_CASE 0x10000
476
477#ifndef U_COMPARE_CODE_POINT_ORDER
478/* see also unistr.h and ustring.h */
484#define U_COMPARE_CODE_POINT_ORDER 0x8000
485#endif
486
553U_STABLE int32_t U_EXPORT2
554unorm_compare(const UChar *s1, int32_t length1,
555 const UChar *s2, int32_t length2,
556 uint32_t options,
557 UErrorCode *pErrorCode);
558
559#endif /* #if !UCONFIG_NO_NORMALIZATION */
560
561#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:200
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:278
#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:167
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_compare(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, uint32_t options, UErrorCode *pErrorCode)
Compare two strings for canonical equivalence.
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:133
@ UNORM_DEFAULT
Default normalization.
Definition unorm.h:143
@ UNORM_NONE
No decomposition/composition.
Definition unorm.h:135
@ UNORM_NFKD
Compatibility decomposition.
Definition unorm.h:139
@ UNORM_NFC
Canonical decomposition followed by canonical composition.
Definition unorm.h:141
@ UNORM_NFD
Canonical decomposition.
Definition unorm.h:137
@ UNORM_NFKC
Compatibility decomposition followed by canonical composition.
Definition unorm.h:145
@ UNORM_FCD
"Fast C or D" form.
Definition unorm.h:147
@ UNORM_MODE_COUNT
One more than the highest normalization mode constant.
Definition unorm.h:150
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