00001
00002
00003
00004
00005
00006
00007 #ifndef UDAT_H
00008 #define UDAT_H
00009
00010 #include "unicode/utypes.h"
00011 #include "unicode/ucal.h"
00012 #include "unicode/unum.h"
00108 typedef void* UDateFormat;
00109
00111 enum UDateFormatStyle {
00113 UDAT_FULL,
00115 UDAT_LONG,
00117 UDAT_MEDIUM,
00119 UDAT_SHORT,
00121 UDAT_DEFAULT = UDAT_MEDIUM,
00123 UDAT_NONE = -1
00124 };
00125 typedef enum UDateFormatStyle UDateFormatStyle;
00126
00145 U_CAPI UDateFormat*
00146 udat_open(UDateFormatStyle timeStyle,
00147 UDateFormatStyle dateStyle,
00148 const char *locale,
00149 const UChar *tzID,
00150 int32_t tzIDLength,
00151 UErrorCode *status);
00152
00166 U_CAPI UDateFormat*
00167 udat_openPattern( const UChar *pattern,
00168 int32_t patternLength,
00169 const char *locale,
00170 UErrorCode *status);
00171
00178 U_CAPI void
00179 udat_close(UDateFormat* format);
00180
00189 U_CAPI UDateFormat*
00190 udat_clone(const UDateFormat *fmt,
00191 UErrorCode *status);
00192
00212 U_CAPI int32_t
00213 udat_format( const UDateFormat* format,
00214 UDate dateToFormat,
00215 UChar* result,
00216 int32_t resultLength,
00217 UFieldPosition* position,
00218 UErrorCode* status);
00219
00234 U_CAPI UDate
00235 udat_parse( const UDateFormat* format,
00236 const UChar* text,
00237 int32_t textLength,
00238 int32_t *parsePos,
00239 UErrorCode *status);
00240
00250 U_CAPI UBool
00251 udat_isLenient(const UDateFormat* fmt);
00252
00262 U_CAPI void
00263 udat_setLenient( UDateFormat* fmt,
00264 UBool isLenient);
00265
00275 U_CAPI const UCalendar*
00276 udat_getCalendar(const UDateFormat* fmt);
00277
00287 U_CAPI void
00288 udat_setCalendar( UDateFormat* fmt,
00289 const UCalendar* calendarToSet);
00290
00300 U_CAPI const UNumberFormat*
00301 udat_getNumberFormat(const UDateFormat* fmt);
00302
00312 U_CAPI void
00313 udat_setNumberFormat( UDateFormat* fmt,
00314 const UNumberFormat* numberFormatToSet);
00315
00325 U_CAPI const char*
00326 udat_getAvailable(int32_t index);
00327
00336 U_CAPI int32_t
00337 udat_countAvailable(void);
00338
00349 U_CAPI UDate
00350 udat_get2DigitYearStart( const UDateFormat *fmt,
00351 UErrorCode *status);
00352
00363 U_CAPI void
00364 udat_set2DigitYearStart( UDateFormat *fmt,
00365 UDate d,
00366 UErrorCode *status);
00367
00380 U_CAPI int32_t
00381 udat_toPattern( const UDateFormat *fmt,
00382 UBool localized,
00383 UChar *result,
00384 int32_t resultLength,
00385 UErrorCode *status);
00386
00397 U_CAPI void
00398 udat_applyPattern( UDateFormat *format,
00399 UBool localized,
00400 const UChar *pattern,
00401 int32_t patternLength);
00402
00404 enum UDateFormatSymbolType {
00406 UDAT_ERAS,
00408 UDAT_MONTHS,
00410 UDAT_SHORT_MONTHS,
00412 UDAT_WEEKDAYS,
00414 UDAT_SHORT_WEEKDAYS,
00416 UDAT_AM_PMS,
00418 UDAT_LOCALIZED_CHARS
00419 };
00420 typedef enum UDateFormatSymbolType UDateFormatSymbolType;
00421
00425 struct UDateFormatSymbols;
00426 typedef struct UDateFormatSymbols UDateFormatSymbols;
00427
00444 U_CAPI int32_t
00445 udat_getSymbols(const UDateFormat *fmt,
00446 UDateFormatSymbolType type,
00447 int32_t index,
00448 UChar *result,
00449 int32_t resultLength,
00450 UErrorCode *status);
00451
00464 U_CAPI int32_t
00465 udat_countSymbols( const UDateFormat *fmt,
00466 UDateFormatSymbolType type);
00467
00484 U_CAPI void
00485 udat_setSymbols( UDateFormat *format,
00486 UDateFormatSymbolType type,
00487 int32_t index,
00488 UChar *value,
00489 int32_t valueLength,
00490 UErrorCode *status);
00491
00492 #endif