ICU 75.1 75.1

uenum.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) 2002-2013, International Business Machines
7 * Corporation and others. All Rights Reserved.
8 *
9 *******************************************************************************
10 * file name: uenum.h
11 * encoding: UTF-8
12 * tab size: 8 (not used)
13 * indentation:2
14 *
15 * created on: 2002jul08
16 * created by: Vladimir Weinstein
17 */
18
19 #ifndef __UENUM_H
20 #define __UENUM_H
21
22 #include "unicode/utypes.h"
23
24 #if U_SHOW_CPLUSPLUS_API
25 #include "unicode/localpointer.h"
26
27 U_NAMESPACE_BEGIN
28 class StringEnumeration;
29 U_NAMESPACE_END
30 #endif // U_SHOW_CPLUSPLUS_API
31
42 struct UEnumeration;
44 typedef struct UEnumeration UEnumeration;
45
53 U_CAPI void U_EXPORT2
54 uenum_close(UEnumeration* en);
55
56 #if U_SHOW_CPLUSPLUS_API
57
58 U_NAMESPACE_BEGIN
59
69 U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close);
70
71 U_NAMESPACE_END
72
73 #endif
74
89 U_CAPI int32_t U_EXPORT2
90 uenum_count(UEnumeration* en, UErrorCode* status);
91
113 U_CAPI const UChar* U_EXPORT2
114 uenum_unext(UEnumeration* en,
115 int32_t* resultLength,
116 UErrorCode* status);
117
146 U_CAPI const char* U_EXPORT2
147 uenum_next(UEnumeration* en,
148 int32_t* resultLength,
149 UErrorCode* status);
150
160 U_CAPI void U_EXPORT2
161 uenum_reset(UEnumeration* en, UErrorCode* status);
162
163 #if U_SHOW_CPLUSPLUS_API
164
174 U_CAPI UEnumeration* U_EXPORT2
175 uenum_openFromStringEnumeration(icu::StringEnumeration* adopted, UErrorCode* ec);
176
177 #endif
178
190 U_CAPI UEnumeration* U_EXPORT2
191 uenum_openUCharStringsEnumeration(const UChar* const strings[], int32_t count,
192 UErrorCode* ec);
193
205 U_CAPI UEnumeration* U_EXPORT2
206 uenum_openCharStringsEnumeration(const char* const strings[], int32_t count,
207 UErrorCode* ec);
208
209 #endif
LocalUEnumerationPointer
"Smart pointer" class, closes a UEnumeration via uenum_close().
icu::StringEnumeration
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:61
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
uenum_count
U_CAPI int32_t uenum_count(UEnumeration *en, UErrorCode *status)
Returns the number of elements that the iterator traverses.
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:44
uenum_openCharStringsEnumeration
U_CAPI UEnumeration * uenum_openCharStringsEnumeration(const char *const strings[], int32_t count, UErrorCode *ec)
Given an array of const char* strings (invariant chars only), return a UEnumeration.
uenum_openUCharStringsEnumeration
U_CAPI UEnumeration * uenum_openUCharStringsEnumeration(const UChar *const strings[], int32_t count, UErrorCode *ec)
Given an array of const UChar* strings, return a UEnumeration.
uenum_reset
U_CAPI void uenum_reset(UEnumeration *en, UErrorCode *status)
Resets the iterator to the current list of service IDs.
uenum_openFromStringEnumeration
U_CAPI UEnumeration * uenum_openFromStringEnumeration(icu::StringEnumeration *adopted, UErrorCode *ec)
Given a StringEnumeration, wrap it in a UEnumeration.
uenum_close
U_CAPI void uenum_close(UEnumeration *en)
Disposes of resources in use by the iterator.
uenum_next
U_CAPI const char * uenum_next(UEnumeration *en, int32_t *resultLength, UErrorCode *status)
Returns the next element in the iterator's list.
uenum_unext
U_CAPI const UChar * uenum_unext(UEnumeration *en, int32_t *resultLength, UErrorCode *status)
Returns the next element in the iterator's list.
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:378
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415