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"
00109 typedef void* UDateFormat;
00110
00112 enum UDateFormatStyle {
00114 UDAT_FULL,
00116 UDAT_LONG,
00118 UDAT_MEDIUM,
00120 UDAT_SHORT,
00122 UDAT_DEFAULT = UDAT_MEDIUM,
00124 UDAT_NONE = -1
00125 };
00126 typedef enum UDateFormatStyle UDateFormatStyle;
00127
00146 U_CAPI UDateFormat*
00147 udat_open(UDateFormatStyle timeStyle,
00148 UDateFormatStyle dateStyle,
00149 const char *locale,
00150 const UChar *tzID,
00151 int32_t tzIDLength,
00152 UErrorCode *status);
00153
00167 U_CAPI UDateFormat*
00168 udat_openPattern( const UChar *pattern,
00169 int32_t patternLength,
00170 const char *locale,
00171 UErrorCode *status);
00172
00179 U_CAPI void
00180 udat_close(UDateFormat* format);
00181
00190 U_CAPI UDateFormat*
00191 udat_clone(const UDateFormat *fmt,
00192 UErrorCode *status);
00193
00208 U_CAPI int32_t
00209 udat_format( const UDateFormat* format,
00210 UDate dateToFormat,
00211 UChar* result,
00212 int32_t resultLength,
00213 UFieldPosition* position,
00214 UErrorCode* status);
00215
00230 U_CAPI UDate
00231 udat_parse( const UDateFormat* format,
00232 const UChar* text,
00233 int32_t textLength,
00234 int32_t *parsePos,
00235 UErrorCode *status);
00236
00246 U_CAPI UBool
00247 udat_isLenient(const UDateFormat* fmt);
00248
00258 U_CAPI void
00259 udat_setLenient( UDateFormat* fmt,
00260 UBool isLenient);
00261
00271 U_CAPI const UCalendar*
00272 udat_getCalendar(const UDateFormat* fmt);
00273
00283 U_CAPI void
00284 udat_setCalendar( UDateFormat* fmt,
00285 const UCalendar* calendarToSet);
00286
00296 U_CAPI const UNumberFormat*
00297 udat_getNumberFormat(const UDateFormat* fmt);
00298
00308 U_CAPI void
00309 udat_setNumberFormat( UDateFormat* fmt,
00310 const UNumberFormat* numberFormatToSet);
00311
00321 U_CAPI const char*
00322 udat_getAvailable(int32_t index);
00323
00332 U_CAPI int32_t
00333 udat_countAvailable(void);
00334
00345 U_CAPI UDate
00346 udat_get2DigitYearStart( const UDateFormat *fmt,
00347 UErrorCode *status);
00348
00359 U_CAPI void
00360 udat_set2DigitYearStart( UDateFormat *fmt,
00361 UDate d,
00362 UErrorCode *status);
00363
00376 U_CAPI int32_t
00377 udat_toPattern( const UDateFormat *fmt,
00378 UBool localized,
00379 UChar *result,
00380 int32_t resultLength,
00381 UErrorCode *status);
00382
00393 U_CAPI void
00394 udat_applyPattern( UDateFormat *format,
00395 UBool localized,
00396 const UChar *pattern,
00397 int32_t patternLength);
00398
00400 enum UDateFormatSymbolType {
00402 UDAT_ERAS,
00404 UDAT_MONTHS,
00406 UDAT_SHORT_MONTHS,
00408 UDAT_WEEKDAYS,
00410 UDAT_SHORT_WEEKDAYS,
00412 UDAT_AM_PMS,
00414 UDAT_LOCALIZED_CHARS
00415 };
00416 typedef enum UDateFormatSymbolType UDateFormatSymbolType;
00417
00421 struct UDateFormatSymbols;
00422 typedef struct UDateFormatSymbols UDateFormatSymbols;
00423
00440 U_CAPI int32_t
00441 udat_getSymbols(const UDateFormat *fmt,
00442 UDateFormatSymbolType type,
00443 int32_t index,
00444 UChar *result,
00445 int32_t resultLength,
00446 UErrorCode *status);
00447
00460 U_CAPI int32_t
00461 udat_countSymbols( const UDateFormat *fmt,
00462 UDateFormatSymbolType type);
00463
00480 U_CAPI void
00481 udat_setSymbols( UDateFormat *format,
00482 UDateFormatSymbolType type,
00483 int32_t index,
00484 UChar *value,
00485 int32_t valueLength,
00486 UErrorCode *status);
00487
00488 #endif