ICU 50.1.2  50.1.2
ucnvsel.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 *
4 * Copyright (C) 2008-2011, International Business Machines
5 * Corporation, Google and others. All Rights Reserved.
6 *
7 *******************************************************************************
8 */
9 /*
10  * Author : eldawy@google.com (Mohamed Eldawy)
11  * ucnvsel.h
12  *
13  * Purpose: To generate a list of encodings capable of handling
14  * a given Unicode text
15  *
16  * Started 09-April-2008
17  */
18 
19 #ifndef __ICU_UCNV_SEL_H__
20 #define __ICU_UCNV_SEL_H__
21 
22 #include "unicode/utypes.h"
23 
24 #if !UCONFIG_NO_CONVERSION
25 
26 #include "unicode/uset.h"
27 #include "unicode/utf16.h"
28 #include "unicode/uenum.h"
29 #include "unicode/ucnv.h"
30 #include "unicode/localpointer.h"
31 
47 struct UConverterSelector;
48 typedef struct UConverterSelector UConverterSelector;
73 U_STABLE UConverterSelector* U_EXPORT2
74 ucnvsel_open(const char* const* converterList, int32_t converterListSize,
75  const USet* excludedCodePoints,
76  const UConverterUnicodeSet whichSet, UErrorCode* status);
77 
91 U_STABLE void U_EXPORT2
92 ucnvsel_close(UConverterSelector *sel);
93 
94 #if U_SHOW_CPLUSPLUS_API
95 
97 
108 
110 
111 #endif
112 
128 U_STABLE UConverterSelector* U_EXPORT2
129 ucnvsel_openFromSerialized(const void* buffer, int32_t length, UErrorCode* status);
130 
145 U_STABLE int32_t U_EXPORT2
146 ucnvsel_serialize(const UConverterSelector* sel,
147  void* buffer, int32_t bufferCapacity, UErrorCode* status);
148 
163 U_STABLE UEnumeration * U_EXPORT2
164 ucnvsel_selectForString(const UConverterSelector* sel,
165  const UChar *s, int32_t length, UErrorCode *status);
166 
181 U_STABLE UEnumeration * U_EXPORT2
182 ucnvsel_selectForUTF8(const UConverterSelector* sel,
183  const char *s, int32_t length, UErrorCode *status);
184 
185 #endif /* !UCONFIG_NO_CONVERSION */
186 
187 #endif /* __ICU_UCNV_SEL_H__ */
UConverterSelector * ucnvsel_openFromSerialized(const void *buffer, int32_t length, UErrorCode *status)
Open a selector from its serialized form.
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...
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:39
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...
void ucnvsel_close(UConverterSelector *sel)
Closes a selector.
C API: Unicode Set.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:290
UConverterUnicodeSet
Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet().
Definition: ucnv.h:931
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
int32_t ucnvsel_serialize(const UConverterSelector *sel, void *buffer, int32_t bufferCapacity, UErrorCode *status)
Serialize a selector into a linear buffer.
C API: 16-bit Unicode handling macros.
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_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
struct USet USet
Definition: ucnv.h:67
"Smart pointer" class, closes a UConverterSelector via ucnvsel_close().
UConverterSelector * ucnvsel_open(const char *const *converterList, int32_t converterListSize, const USet *excludedCodePoints, const UConverterUnicodeSet whichSet, UErrorCode *status)
Open a selector.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
C API: String Enumeration.
Basic definitions for ICU, for both C and C++ APIs.
C API: Character conversion.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109