]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/uenumimp.h
2 *******************************************************************************
4 * Copyright (C) 2002, 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 should return the next element
64 * @param en enumeration
65 * @param resultLength pointer to result length
66 * @param status pointer to UErrorCode variable
67 * @return next element as UChar *
69 typedef const UChar
* U_CALLCONV
70 UEnumUNext(UEnumeration
* en
,
71 int32_t* resultLength
,
75 * Function type declaration for uenum_next().
77 * This function should return the next element
80 * @param en enumeration
81 * @param resultLength pointer to result length
82 * @param status pointer to UErrorCode variable
83 * @return next element as char *
85 typedef const char* U_CALLCONV
86 UEnumNext(UEnumeration
* en
,
87 int32_t* resultLength
,
91 * Function type declaration for uenum_reset().
93 * This function should reset the enumeration
96 * @param en enumeration
97 * @param status pointer to UErrorCode variable
99 typedef void U_CALLCONV
100 UEnumReset(UEnumeration
* en
,
104 struct UEnumeration
{
105 /* baseContext. For the base class only. Don't touch! */
108 /* context. Use it for what you need */
112 * these are functions that will
115 /* called from uenum_close */
117 /* called from uenum_count */
119 /* called from uenum_unext */
121 /* called from uenum_next */
123 /* called from uenum_reset */
129 /* This is the default implementation for uenum_unext().
130 * It automatically converts the char * string to UChar *.
131 * Don't call this directly. This is called internally by uenum_unext
132 * when a UEnumeration is defined with 'uNext' pointing to this
135 U_CAPI
const UChar
* U_EXPORT2
136 uenum_unextDefault(UEnumeration
* en
,
137 int32_t* resultLength
,
140 /* This is the default implementation for uenum_next().
141 * It automatically converts the UChar * string to char *.
142 * Don't call this directly. This is called internally by uenum_next
143 * when a UEnumeration is defined with 'next' pointing to this
146 U_CAPI
const char* U_EXPORT2
147 uenum_nextDefault(UEnumeration
* en
,
148 int32_t* resultLength
,