ICU 62.1  62.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 #include "unicode/localpointer.h"
24 
25 #if U_SHOW_CPLUSPLUS_API
27 class StringEnumeration;
29 #endif
30 
41 struct UEnumeration;
43 typedef struct UEnumeration UEnumeration;
44 
52 U_STABLE void U_EXPORT2
54 
55 #if U_SHOW_CPLUSPLUS_API
56 
58 
69 
71 
72 #endif
73 
88 U_STABLE int32_t U_EXPORT2
89 uenum_count(UEnumeration* en, UErrorCode* status);
90 
112 U_STABLE const UChar* U_EXPORT2
114  int32_t* resultLength,
115  UErrorCode* status);
116 
145 U_STABLE const char* U_EXPORT2
147  int32_t* resultLength,
148  UErrorCode* status);
149 
159 U_STABLE void U_EXPORT2
160 uenum_reset(UEnumeration* en, UErrorCode* status);
161 
162 #if U_SHOW_CPLUSPLUS_API
163 
173 U_STABLE UEnumeration* U_EXPORT2
175 
176 #endif
177 
189 U_STABLE UEnumeration* U_EXPORT2
190 uenum_openUCharStringsEnumeration(const UChar* const strings[], int32_t count,
191  UErrorCode* ec);
192 
193 /* Note: next function is not hidden as draft, as it is used internally (it was formerly an internal function). */
194 
206 U_STABLE UEnumeration* U_EXPORT2
207 uenum_openCharStringsEnumeration(const char* const strings[], int32_t count,
208  UErrorCode* ec);
209 
210 #endif
uenum_unext
const UChar * uenum_unext(UEnumeration *en, int32_t *resultLength, UErrorCode *status)
Returns the next element in the iterator's list.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:396
icu::StringEnumeration
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:57
uenum_reset
void uenum_reset(UEnumeration *en, UErrorCode *status)
Resets the iterator to the current list of service IDs.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
Definition: localpointer.h:487
uenum_openUCharStringsEnumeration
UEnumeration * uenum_openUCharStringsEnumeration(const UChar *const strings[], int32_t count, UErrorCode *ec)
Given an array of const UChar* strings, return a UEnumeration.
uenum_count
int32_t uenum_count(UEnumeration *en, UErrorCode *status)
Returns the number of elements that the iterator traverses.
uenum_openCharStringsEnumeration
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.
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
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
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:43
LocalUEnumerationPointer
uenum_close
void uenum_close(UEnumeration *en)
Disposes of resources in use by the iterator.
U_NAMESPACE_END
#define U_NAMESPACE_END
Definition: uversion.h:138
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
Definition: uversion.h:137
uenum_next
const char * uenum_next(UEnumeration *en, int32_t *resultLength, UErrorCode *status)
Returns the next element in the iterator's list.
uenum_openFromStringEnumeration
UEnumeration * uenum_openFromStringEnumeration(icu::StringEnumeration *adopted, UErrorCode *ec)
Given a StringEnumeration, wrap it in a UEnumeration.