ICU 62.1  62.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 #include "unicode/localpointer.h"
33 
49 struct UConverterSelector;
50 typedef struct UConverterSelector UConverterSelector;
75 U_STABLE UConverterSelector* U_EXPORT2
76 ucnvsel_open(const char* const* converterList, int32_t converterListSize,
77  const USet* excludedCodePoints,
78  const UConverterUnicodeSet whichSet, UErrorCode* status);
79 
93 U_STABLE void U_EXPORT2
94 ucnvsel_close(UConverterSelector *sel);
95 
96 #if U_SHOW_CPLUSPLUS_API
97 
99 
110 
112 
113 #endif
114 
130 U_STABLE UConverterSelector* U_EXPORT2
131 ucnvsel_openFromSerialized(const void* buffer, int32_t length, UErrorCode* status);
132 
147 U_STABLE int32_t U_EXPORT2
148 ucnvsel_serialize(const UConverterSelector* sel,
149  void* buffer, int32_t bufferCapacity, UErrorCode* status);
150 
165 U_STABLE UEnumeration * U_EXPORT2
166 ucnvsel_selectForString(const UConverterSelector* sel,
167  const UChar *s, int32_t length, UErrorCode *status);
168 
183 U_STABLE UEnumeration * U_EXPORT2
184 ucnvsel_selectForUTF8(const UConverterSelector* sel,
185  const char *s, int32_t length, UErrorCode *status);
186 
187 #endif /* !UCONFIG_NO_CONVERSION */
188 
189 #endif /* __ICU_UCNV_SEL_H__ */
ucnvsel_openFromSerialized
UConverterSelector * ucnvsel_openFromSerialized(const void *buffer, int32_t length, UErrorCode *status)
Open a selector from its serialized form.
ucnvsel_selectForUTF8
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.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
ucnvsel_close
void ucnvsel_close(UConverterSelector *sel)
Closes a selector.
ucnvsel_selectForString
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.
ucnv.h
C API: Character conversion.
ucnvsel_serialize
int32_t ucnvsel_serialize(const UConverterSelector *sel, void *buffer, int32_t bufferCapacity, UErrorCode *status)
Serialize a selector into a linear buffer.
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:396
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:487
ucnvsel_open
UConverterSelector * ucnvsel_open(const char *const *converterList, int32_t converterListSize, const USet *excludedCodePoints, const UConverterUnicodeSet whichSet, UErrorCode *status)
Open a selector.
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:941
LocalUConverterSelectorPointer
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
UChar
uint16_t UChar
Definition: umachine.h:353
USet
struct USet USet
Definition: ucnv.h:69
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:43
U_NAMESPACE_END
#define U_NAMESPACE_END
Definition: uversion.h:138
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
Definition: uversion.h:137
uenum.h
C API: String Enumeration.