00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef ULISTFORMATTER_H
00011 #define ULISTFORMATTER_H
00012
00013 #include "unicode/utypes.h"
00014
00015 #if !UCONFIG_NO_FORMATTING
00016
00017 #include "unicode/localpointer.h"
00018 #include "unicode/uformattedvalue.h"
00019
00034 struct UListFormatter;
00035 typedef struct UListFormatter UListFormatter;
00037 #ifndef U_HIDE_DRAFT_API
00038 struct UFormattedList;
00043 typedef struct UFormattedList UFormattedList;
00044 #endif
00045
00046 #ifndef U_HIDE_DRAFT_API
00047
00052 typedef enum UListFormatterField {
00057 ULISTFMT_LITERAL_FIELD,
00062 ULISTFMT_ELEMENT_FIELD
00063 } UListFormatterField;
00064 #endif
00065
00082 U_CAPI UListFormatter* U_EXPORT2
00083 ulistfmt_open(const char* locale,
00084 UErrorCode* status);
00085
00092 U_CAPI void U_EXPORT2
00093 ulistfmt_close(UListFormatter *listfmt);
00094
00095 #ifndef U_HIDE_DRAFT_API
00096
00105 U_CAPI UFormattedList* U_EXPORT2
00106 ulistfmt_openResult(UErrorCode* ec);
00107
00129 U_CAPI const UFormattedValue* U_EXPORT2
00130 ulistfmt_resultAsValue(const UFormattedList* uresult, UErrorCode* ec);
00131
00138 U_CAPI void U_EXPORT2
00139 ulistfmt_closeResult(UFormattedList* uresult);
00140 #endif
00141
00142
00143 #if U_SHOW_CPLUSPLUS_API
00144
00145 U_NAMESPACE_BEGIN
00146
00156 U_DEFINE_LOCAL_OPEN_POINTER(LocalUListFormatterPointer, UListFormatter, ulistfmt_close);
00157
00158 #ifndef U_HIDE_DRAFT_API
00159
00168 U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedListPointer, UFormattedList, ulistfmt_closeResult);
00169 #endif
00170
00171 U_NAMESPACE_END
00172
00173 #endif
00174
00209 U_CAPI int32_t U_EXPORT2
00210 ulistfmt_format(const UListFormatter* listfmt,
00211 const UChar* const strings[],
00212 const int32_t * stringLengths,
00213 int32_t stringCount,
00214 UChar* result,
00215 int32_t resultCapacity,
00216 UErrorCode* status);
00217
00218 #ifndef U_HIDE_DRAFT_API
00219
00245 U_CAPI void U_EXPORT2
00246 ulistfmt_formatStringsToResult(
00247 const UListFormatter* listfmt,
00248 const UChar* const strings[],
00249 const int32_t * stringLengths,
00250 int32_t stringCount,
00251 UFormattedList* uresult,
00252 UErrorCode* status);
00253 #endif
00254
00255 #endif
00256
00257 #endif