]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/uenumimp.h
2 *******************************************************************************
4 * Copyright (C) 2002-2006, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: uenumimp.h
10 * tab size: 8 (not used)
13 * created on: 2002jul08
14 * created by: Vladimir Weinstein
20 #include "unicode/uenum.h"
25 * following are the type declarations for
26 * implementations of APIs. If any of these
27 * functions are NULL, U_UNSUPPORTED_ERROR
28 * is returned. If close is NULL, the enumeration
29 * object is going to be released.
30 * Initial error checking is done in the body
31 * of API function, so the implementations
32 * need not to check the initial error condition.
36 * Function type declaration for uenum_close().
38 * This function should cleanup the enumerator object
40 * @param en enumeration to be closed
42 typedef void U_CALLCONV
43 UEnumClose(UEnumeration
*en
);
46 * Function type declaration for uenum_count().
48 * This function should count the number of elements
51 * @param en enumeration to be counted
52 * @param status pointer to UErrorCode variable
53 * @return number of elements in enumeration
55 typedef int32_t U_CALLCONV
56 UEnumCount(UEnumeration
*en
, UErrorCode
*status
);
59 * Function type declaration for uenum_unext().
61 * This function returns the next element as a UChar *,
62 * or NULL after all elements haven been enumerated.
64 * @param en enumeration
65 * @param resultLength pointer to result length
66 * @param status pointer to UErrorCode variable
67 * @return next element as UChar *,
68 * or NULL after all elements haven been enumerated
70 typedef const UChar
* U_CALLCONV
71 UEnumUNext(UEnumeration
* en
,
72 int32_t* resultLength
,
76 * Function type declaration for uenum_next().
78 * This function returns the next element as a char *,
79 * or NULL after all elements haven been enumerated.
81 * @param en enumeration
82 * @param resultLength pointer to result length
83 * @param status pointer to UErrorCode variable
84 * @return next element as char *,
85 * or NULL after all elements haven been enumerated
87 typedef const char* U_CALLCONV
88 UEnumNext(UEnumeration
* en
,
89 int32_t* resultLength
,
93 * Function type declaration for uenum_reset().
95 * This function should reset the enumeration
98 * @param en enumeration
99 * @param status pointer to UErrorCode variable
101 typedef void U_CALLCONV
102 UEnumReset(UEnumeration
* en
,
106 struct UEnumeration
{
107 /* baseContext. For the base class only. Don't touch! */
110 /* context. Use it for what you need */
114 * these are functions that will
117 /* called from uenum_close */
119 /* called from uenum_count */
121 /* called from uenum_unext */
123 /* called from uenum_next */
125 /* called from uenum_reset */
131 /* This is the default implementation for uenum_unext().
132 * It automatically converts the char * string to UChar *.
133 * Don't call this directly. This is called internally by uenum_unext
134 * when a UEnumeration is defined with 'uNext' pointing to this
137 U_CAPI
const UChar
* U_EXPORT2
138 uenum_unextDefault(UEnumeration
* en
,
139 int32_t* resultLength
,
142 /* This is the default implementation for uenum_next().
143 * It automatically converts the UChar * string to char *.
144 * Don't call this directly. This is called internally by uenum_next
145 * when a UEnumeration is defined with 'next' pointing to this
148 U_CAPI
const char* U_EXPORT2
149 uenum_nextDefault(UEnumeration
* en
,
150 int32_t* resultLength
,