ICU 71.1 71.1

ucnvsel.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 *
6 * Copyright (C) 2008-2011, International Business Machines
7 * Corporation, Google and others. All Rights Reserved.
8 *
9 *******************************************************************************
10 */
11 /*
12 * Author : eldawy@google.com (Mohamed Eldawy)
13 * ucnvsel.h
14 *
15 * Purpose: To generate a list of encodings capable of handling
16 * a given Unicode text
17 *
18 * Started 09-April-2008
19 */
20
21 #ifndef __ICU_UCNV_SEL_H__
22 #define __ICU_UCNV_SEL_H__
23
24 #include "unicode/utypes.h"
25
26 #if !UCONFIG_NO_CONVERSION
27
28 #include "unicode/uset.h"
29 #include "unicode/utf16.h"
30 #include "unicode/uenum.h"
31 #include "unicode/ucnv.h"
32
33 #if U_SHOW_CPLUSPLUS_API
34 #include "unicode/localpointer.h"
35 #endif // U_SHOW_CPLUSPLUS_API
36
48 struct UConverterSelector;
53 typedef struct UConverterSelector UConverterSelector;
78 U_CAPI UConverterSelector* U_EXPORT2
79 ucnvsel_open(const char* const* converterList, int32_t converterListSize,
80 const USet* excludedCodePoints,
81 const UConverterUnicodeSet whichSet, UErrorCode* status);
82
96 U_CAPI void U_EXPORT2
97 ucnvsel_close(UConverterSelector *sel);
98
99 #if U_SHOW_CPLUSPLUS_API
100
101 U_NAMESPACE_BEGIN
102
112 U_DEFINE_LOCAL_OPEN_POINTER(LocalUConverterSelectorPointer, UConverterSelector, ucnvsel_close);
113
114 U_NAMESPACE_END
115
116 #endif
117
133 U_CAPI UConverterSelector* U_EXPORT2
134 ucnvsel_openFromSerialized(const void* buffer, int32_t length, UErrorCode* status);
135
150 U_CAPI int32_t U_EXPORT2
151 ucnvsel_serialize(const UConverterSelector* sel,
152 void* buffer, int32_t bufferCapacity, UErrorCode* status);
153
168 U_CAPI UEnumeration * U_EXPORT2
169 ucnvsel_selectForString(const UConverterSelector* sel,
170 const UChar *s, int32_t length, UErrorCode *status);
171
186 U_CAPI UEnumeration * U_EXPORT2
187 ucnvsel_selectForUTF8(const UConverterSelector* sel,
188 const char *s, int32_t length, UErrorCode *status);
189
190 #endif /* !UCONFIG_NO_CONVERSION */
191
192 #endif /* __ICU_UCNV_SEL_H__ */
ucnvsel_serialize
U_CAPI int32_t ucnvsel_serialize(const UConverterSelector *sel, void *buffer, int32_t bufferCapacity, UErrorCode *status)
Serialize a selector into a linear buffer.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UConverterSelector
struct UConverterSelector UConverterSelector
Typedef for selector data structure.
Definition: ucnvsel.h:53
ucnvsel_close
U_CAPI void ucnvsel_close(UConverterSelector *sel)
Closes a selector.
ucnv.h
C API: Character conversion.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
ucnvsel_selectForUTF8
U_CAPI UEnumeration * ucnvsel_selectForUTF8(const UConverterSelector *sel, const char *s, int32_t length, UErrorCode *status)
Select converters that can map all characters in a UTF-8 string, ignoring the excluded code points.
utf16.h
C API: 16-bit Unicode handling macros.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
Definition: localpointer.h:550
uset.h
C API: Unicode Set.
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UConverterUnicodeSet
UConverterUnicodeSet
Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet().
Definition: ucnv.h:954
LocalUConverterSelectorPointer
ucnvsel_openFromSerialized
U_CAPI UConverterSelector * ucnvsel_openFromSerialized(const void *buffer, int32_t length, UErrorCode *status)
Open a selector from its serialized form.
ucnvsel_open
U_CAPI UConverterSelector * ucnvsel_open(const char *const *converterList, int32_t converterListSize, const USet *excludedCodePoints, const UConverterUnicodeSet whichSet, UErrorCode *status)
Open a selector.
UChar
char16_t UChar
Definition: umachine.h:418
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:44
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
USet
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
Definition: uset.h:50
uenum.h
C API: String Enumeration.
ucnvsel_selectForString
U_CAPI UEnumeration * ucnvsel_selectForString(const UConverterSelector *sel, const UChar *s, int32_t length, UErrorCode *status)
Select converters that can map all characters in a UTF-16 string, ignoring the excluded code points.