00001
00002
00003
00004
00005
00006
00007
#ifndef UDAT_H
00008
#define UDAT_H
00009
00010
#include "unicode/utypes.h"
00011
00012
#if !UCONFIG_NO_FORMATTING
00013
00014
#include "unicode/ucal.h"
00015
#include "unicode/unum.h"
00137 typedef void*
UDateFormat;
00138
00142 typedef enum UDateFormatStyle {
00144
UDAT_FULL,
00146
UDAT_LONG,
00148
UDAT_MEDIUM,
00150
UDAT_SHORT,
00152
UDAT_DEFAULT =
UDAT_MEDIUM,
00154
UDAT_NONE = -1,
00156
UDAT_IGNORE = -2
00157
00158 }
UDateFormatStyle;
00159
00179
U_CAPI UDateFormat* U_EXPORT2
00180
udat_open(UDateFormatStyle timeStyle,
00181 UDateFormatStyle dateStyle,
00182
const char *locale,
00183
const UChar *tzID,
00184 int32_t tzIDLength,
00185
const UChar *pattern,
00186 int32_t patternLength,
00187
UErrorCode *status);
00188
00189
00196
U_CAPI void U_EXPORT2
00197
udat_close(UDateFormat* format);
00198
00207
U_CAPI UDateFormat* U_EXPORT2
00208
udat_clone(
const UDateFormat *fmt,
00209
UErrorCode *status);
00210
00229
U_CAPI int32_t U_EXPORT2
00230
udat_format(
const UDateFormat* format,
00231
UDate dateToFormat,
00232
UChar* result,
00233 int32_t resultLength,
00234
UFieldPosition* position,
00235
UErrorCode* status);
00236
00250
U_CAPI UDate U_EXPORT2
00251
udat_parse(
const UDateFormat* format,
00252
const UChar* text,
00253 int32_t textLength,
00254 int32_t *parsePos,
00255
UErrorCode *status);
00256
00270
U_CAPI void U_EXPORT2
00271
udat_parseCalendar(
const UDateFormat* format,
00272
UCalendar* calendar,
00273
const UChar* text,
00274 int32_t textLength,
00275 int32_t *parsePos,
00276
UErrorCode *status);
00277
00287
U_CAPI UBool U_EXPORT2
00288
udat_isLenient(
const UDateFormat* fmt);
00289
00299
U_CAPI void U_EXPORT2
00300
udat_setLenient( UDateFormat* fmt,
00301
UBool isLenient);
00302
00312
U_CAPI const UCalendar* U_EXPORT2
00313
udat_getCalendar(
const UDateFormat* fmt);
00314
00324
U_CAPI void U_EXPORT2
00325
udat_setCalendar( UDateFormat* fmt,
00326
const UCalendar* calendarToSet);
00327
00337
U_CAPI const UNumberFormat* U_EXPORT2
00338
udat_getNumberFormat(
const UDateFormat* fmt);
00339
00349
U_CAPI void U_EXPORT2
00350
udat_setNumberFormat( UDateFormat* fmt,
00351
const UNumberFormat* numberFormatToSet);
00352
00362
U_CAPI const char* U_EXPORT2
00363
udat_getAvailable(int32_t index);
00364
00373
U_CAPI int32_t U_EXPORT2
00374
udat_countAvailable(
void);
00375
00386
U_CAPI UDate U_EXPORT2
00387
udat_get2DigitYearStart(
const UDateFormat *fmt,
00388
UErrorCode *status);
00389
00400
U_CAPI void U_EXPORT2
00401
udat_set2DigitYearStart( UDateFormat *fmt,
00402
UDate d,
00403
UErrorCode *status);
00404
00417
U_CAPI int32_t U_EXPORT2
00418
udat_toPattern(
const UDateFormat *fmt,
00419
UBool localized,
00420
UChar *result,
00421 int32_t resultLength,
00422
UErrorCode *status);
00423
00434
U_CAPI void U_EXPORT2
00435
udat_applyPattern( UDateFormat *format,
00436
UBool localized,
00437
const UChar *pattern,
00438 int32_t patternLength);
00439
00444 typedef enum UDateFormatSymbolType {
00446
UDAT_ERAS,
00448
UDAT_MONTHS,
00450
UDAT_SHORT_MONTHS,
00452
UDAT_WEEKDAYS,
00454
UDAT_SHORT_WEEKDAYS,
00456
UDAT_AM_PMS,
00458
UDAT_LOCALIZED_CHARS
00459 }
UDateFormatSymbolType;
00460
00461
struct UDateFormatSymbols;
00466 typedef struct UDateFormatSymbols UDateFormatSymbols;
00467
00484
U_CAPI int32_t U_EXPORT2
00485
udat_getSymbols(
const UDateFormat *fmt,
00486 UDateFormatSymbolType type,
00487 int32_t index,
00488
UChar *result,
00489 int32_t resultLength,
00490
UErrorCode *status);
00491
00504
U_CAPI int32_t U_EXPORT2
00505
udat_countSymbols(
const UDateFormat *fmt,
00506 UDateFormatSymbolType type);
00507
00523
U_CAPI void U_EXPORT2
00524
udat_setSymbols( UDateFormat *format,
00525 UDateFormatSymbolType type,
00526 int32_t index,
00527
UChar *value,
00528 int32_t valueLength,
00529
UErrorCode *status);
00530
00540
U_CAPI const char* U_EXPORT2
00541
udat_getLocaleByType(
const UDateFormat *fmt,
00542 ULocDataLocaleType type,
00543
UErrorCode* status);
00544
00545
#endif
00546
00547
#endif