]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/uenumimp.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
6 * Copyright (C) 2002-2006, International Business Machines
7 * Corporation and others. All Rights Reserved.
9 *******************************************************************************
10 * file name: uenumimp.h
12 * tab size: 8 (not used)
15 * created on: 2002jul08
16 * created by: Vladimir Weinstein
22 #include "unicode/uenum.h"
27 * following are the type declarations for
28 * implementations of APIs. If any of these
29 * functions are NULL, U_UNSUPPORTED_ERROR
30 * is returned. If close is NULL, the enumeration
31 * object is going to be released.
32 * Initial error checking is done in the body
33 * of API function, so the implementations
34 * need not to check the initial error condition.
38 * Function type declaration for uenum_close().
40 * This function should cleanup the enumerator object
42 * @param en enumeration to be closed
44 typedef void U_CALLCONV
45 UEnumClose(UEnumeration
*en
);
48 * Function type declaration for uenum_count().
50 * This function should count the number of elements
53 * @param en enumeration to be counted
54 * @param status pointer to UErrorCode variable
55 * @return number of elements in enumeration
57 typedef int32_t U_CALLCONV
58 UEnumCount(UEnumeration
*en
, UErrorCode
*status
);
61 * Function type declaration for uenum_unext().
63 * This function returns the next element as a UChar *,
64 * or NULL after all elements haven been enumerated.
66 * @param en enumeration
67 * @param resultLength pointer to result length
68 * @param status pointer to UErrorCode variable
69 * @return next element as UChar *,
70 * or NULL after all elements haven been enumerated
72 typedef const UChar
* U_CALLCONV
73 UEnumUNext(UEnumeration
* en
,
74 int32_t* resultLength
,
78 * Function type declaration for uenum_next().
80 * This function returns the next element as a char *,
81 * or NULL after all elements haven been enumerated.
83 * @param en enumeration
84 * @param resultLength pointer to result length
85 * @param status pointer to UErrorCode variable
86 * @return next element as char *,
87 * or NULL after all elements haven been enumerated
89 typedef const char* U_CALLCONV
90 UEnumNext(UEnumeration
* en
,
91 int32_t* resultLength
,
95 * Function type declaration for uenum_reset().
97 * This function should reset the enumeration
100 * @param en enumeration
101 * @param status pointer to UErrorCode variable
103 typedef void U_CALLCONV
104 UEnumReset(UEnumeration
* en
,
108 struct UEnumeration
{
109 /* baseContext. For the base class only. Don't touch! */
112 /* context. Use it for what you need */
116 * these are functions that will
119 /* called from uenum_close */
121 /* called from uenum_count */
123 /* called from uenum_unext */
125 /* called from uenum_next */
127 /* called from uenum_reset */
133 /* This is the default implementation for uenum_unext().
134 * It automatically converts the char * string to UChar *.
135 * Don't call this directly. This is called internally by uenum_unext
136 * when a UEnumeration is defined with 'uNext' pointing to this
139 U_CAPI
const UChar
* U_EXPORT2
140 uenum_unextDefault(UEnumeration
* en
,
141 int32_t* resultLength
,
144 /* This is the default implementation for uenum_next().
145 * It automatically converts the UChar * string to char *.
146 * Don't call this directly. This is called internally by uenum_next
147 * when a UEnumeration is defined with 'next' pointing to this
150 U_CAPI
const char* U_EXPORT2
151 uenum_nextDefault(UEnumeration
* en
,
152 int32_t* resultLength
,