ICU 50.2 50.2
unorm2.h
Go to the documentation of this file.
1/*
2*******************************************************************************
3*
4* Copyright (C) 2009-2012, International Business Machines
5* Corporation and others. All Rights Reserved.
6*
7*******************************************************************************
8* file name: unorm2.h
9* encoding: US-ASCII
10* tab size: 8 (not used)
11* indentation:4
12*
13* created on: 2009dec15
14* created by: Markus W. Scherer
15*/
16
17#ifndef __UNORM2_H__
18#define __UNORM2_H__
19
30
31#include "unicode/utypes.h"
33#include "unicode/uset.h"
34
85
111
116struct UNormalizer2;
118
119#if !UCONFIG_NO_NORMALIZATION
120
121#ifndef U_HIDE_DRAFT_API
133U_DRAFT const UNormalizer2 * U_EXPORT2
135
147U_DRAFT const UNormalizer2 * U_EXPORT2
149
161U_DRAFT const UNormalizer2 * U_EXPORT2
163
175U_DRAFT const UNormalizer2 * U_EXPORT2
177
189U_DRAFT const UNormalizer2 * U_EXPORT2
191#endif /* U_HIDE_DRAFT_API */
192
214U_STABLE const UNormalizer2 * U_EXPORT2
215unorm2_getInstance(const char *packageName,
216 const char *name,
218 UErrorCode *pErrorCode);
219
235U_STABLE UNormalizer2 * U_EXPORT2
236unorm2_openFiltered(const UNormalizer2 *norm2, const USet *filterSet, UErrorCode *pErrorCode);
237
244U_STABLE void U_EXPORT2
246
247#if U_SHOW_CPLUSPLUS_API
248
250
261
263
264#endif
265
282U_STABLE int32_t U_EXPORT2
284 const UChar *src, int32_t length,
285 UChar *dest, int32_t capacity,
286 UErrorCode *pErrorCode);
305U_STABLE int32_t U_EXPORT2
307 UChar *first, int32_t firstLength, int32_t firstCapacity,
308 const UChar *second, int32_t secondLength,
309 UErrorCode *pErrorCode);
328U_STABLE int32_t U_EXPORT2
330 UChar *first, int32_t firstLength, int32_t firstCapacity,
331 const UChar *second, int32_t secondLength,
332 UErrorCode *pErrorCode);
333
353U_STABLE int32_t U_EXPORT2
355 UChar32 c, UChar *decomposition, int32_t capacity,
356 UErrorCode *pErrorCode);
357
358#ifndef U_HIDE_DRAFT_API
388U_DRAFT int32_t U_EXPORT2
390 UChar32 c, UChar *decomposition, int32_t capacity,
391 UErrorCode *pErrorCode);
392
408U_DRAFT UChar32 U_EXPORT2
410
420U_DRAFT uint8_t U_EXPORT2
422#endif /* U_HIDE_DRAFT_API */
423
440U_STABLE UBool U_EXPORT2
442 const UChar *s, int32_t length,
443 UErrorCode *pErrorCode);
444
464 const UChar *s, int32_t length,
465 UErrorCode *pErrorCode);
466
491U_STABLE int32_t U_EXPORT2
493 const UChar *s, int32_t length,
494 UErrorCode *pErrorCode);
495
505U_STABLE UBool U_EXPORT2
507
517U_STABLE UBool U_EXPORT2
519
528U_STABLE UBool U_EXPORT2
530
531#endif /* !UCONFIG_NO_NORMALIZATION */
532#endif /* __UNORM2_H__ */
"Smart pointer" class, closes a UNormalizer2 via unorm2_close().
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
struct USet USet
A UnicodeSet.
Definition ucnv.h:67
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition umachine.h:298
int8_t UBool
The ICU boolean type.
Definition umachine.h:200
#define U_DRAFT
This is used to declare a function as a draft public ICU C API.
Definition umachine.h:111
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
const UNormalizer2 * unorm2_getNFDInstance(UErrorCode *pErrorCode)
Returns a UNormalizer2 instance for Unicode NFD normalization.
UNormalizationCheckResult
Result values for normalization quick check functions.
Definition unorm2.h:91
@ UNORM_YES
The input string is in the normalization form.
Definition unorm2.h:101
@ UNORM_MAYBE
The input string may or may not be in the normalization form.
Definition unorm2.h:109
@ UNORM_NO
The input string is not in the normalization form.
Definition unorm2.h:96
int32_t unorm2_spanQuickCheckYes(const UNormalizer2 *norm2, const UChar *s, int32_t length, UErrorCode *pErrorCode)
Returns the end of the normalized substring of the input string.
int32_t unorm2_getRawDecomposition(const UNormalizer2 *norm2, UChar32 c, UChar *decomposition, int32_t capacity, UErrorCode *pErrorCode)
Gets the raw decomposition mapping of c.
UBool unorm2_hasBoundaryAfter(const UNormalizer2 *norm2, UChar32 c)
Tests if the character always has a normalization boundary after it, regardless of context.
int32_t unorm2_normalize(const UNormalizer2 *norm2, const UChar *src, int32_t length, UChar *dest, int32_t capacity, UErrorCode *pErrorCode)
Writes the normalized form of the source string to the destination string (replacing its contents) an...
UBool unorm2_isInert(const UNormalizer2 *norm2, UChar32 c)
Tests if the character is normalization-inert.
UNormalization2Mode
Constants for normalization modes.
Definition unorm2.h:42
@ UNORM2_COMPOSE
Decomposition followed by composition.
Definition unorm2.h:51
@ UNORM2_FCD
"Fast C or D" form.
Definition unorm2.h:73
@ UNORM2_COMPOSE_CONTIGUOUS
Compose only contiguously.
Definition unorm2.h:83
@ UNORM2_DECOMPOSE
Map, and reorder canonically.
Definition unorm2.h:60
const UNormalizer2 * unorm2_getInstance(const char *packageName, const char *name, UNormalization2Mode mode, UErrorCode *pErrorCode)
Returns a UNormalizer2 instance which uses the specified data file (packageName/name similar to ucnv_...
const UNormalizer2 * unorm2_getNFKCCasefoldInstance(UErrorCode *pErrorCode)
Returns a UNormalizer2 instance for Unicode NFKC_Casefold normalization.
uint8_t unorm2_getCombiningClass(const UNormalizer2 *norm2, UChar32 c)
Gets the combining class of c.
int32_t unorm2_getDecomposition(const UNormalizer2 *norm2, UChar32 c, UChar *decomposition, int32_t capacity, UErrorCode *pErrorCode)
Gets the decomposition mapping of c.
UChar32 unorm2_composePair(const UNormalizer2 *norm2, UChar32 a, UChar32 b)
Performs pairwise composition of a & b and returns the composite if there is one.
UNormalizer2 * unorm2_openFiltered(const UNormalizer2 *norm2, const USet *filterSet, UErrorCode *pErrorCode)
Constructs a filtered normalizer wrapping any UNormalizer2 instance and a filter set.
int32_t unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2, UChar *first, int32_t firstLength, int32_t firstCapacity, const UChar *second, int32_t secondLength, UErrorCode *pErrorCode)
Appends the normalized form of the second string to the first string (merging them at the boundary) a...
const UNormalizer2 * unorm2_getNFKDInstance(UErrorCode *pErrorCode)
Returns a UNormalizer2 instance for Unicode NFKD normalization.
void unorm2_close(UNormalizer2 *norm2)
Closes a UNormalizer2 instance from unorm2_openFiltered().
UBool unorm2_hasBoundaryBefore(const UNormalizer2 *norm2, UChar32 c)
Tests if the character always has a normalization boundary before it, regardless of context.
const UNormalizer2 * unorm2_getNFKCInstance(UErrorCode *pErrorCode)
Returns a UNormalizer2 instance for Unicode NFKC normalization.
UNormalizationCheckResult unorm2_quickCheck(const UNormalizer2 *norm2, const UChar *s, int32_t length, UErrorCode *pErrorCode)
Tests if the string is normalized.
const UNormalizer2 * unorm2_getNFCInstance(UErrorCode *pErrorCode)
Returns a UNormalizer2 instance for Unicode NFC normalization.
struct UNormalizer2 UNormalizer2
C typedef for struct UNormalizer2.
Definition unorm2.h:117
int32_t unorm2_append(const UNormalizer2 *norm2, UChar *first, int32_t firstLength, int32_t firstCapacity, const UChar *second, int32_t secondLength, UErrorCode *pErrorCode)
Appends the second string to the first string (merging them at the boundary) and returns the length o...
UBool unorm2_isNormalized(const UNormalizer2 *norm2, const UChar *s, int32_t length, UErrorCode *pErrorCode)
Tests if the string is normalized.
C API: Unicode Set.
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
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:130
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:129