udat.h

Go to the documentation of this file.
00001 /*
00002  *******************************************************************************
00003  * Copyright (C) 1996-2007, International Business Machines
00004  * Corporation and others. All Rights Reserved.
00005  *******************************************************************************
00006 */
00007 
00008 #ifndef UDAT_H
00009 #define UDAT_H
00010 
00011 #include "unicode/utypes.h"
00012 
00013 #if !UCONFIG_NO_FORMATTING
00014 
00015 #include "unicode/ucal.h"
00016 #include "unicode/unum.h"
00138 typedef void* UDateFormat;
00139 
00143 typedef enum UDateFormatStyle {
00145     UDAT_FULL,
00147     UDAT_LONG,
00149     UDAT_MEDIUM,
00151     UDAT_SHORT,
00153     UDAT_DEFAULT = UDAT_MEDIUM,
00154 
00156     UDAT_RELATIVE = (1 << 7),
00157     
00158     UDAT_FULL_RELATIVE = UDAT_FULL | UDAT_RELATIVE,
00159         
00160     UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE,
00161     
00162     UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE,
00163     
00164     UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE,
00165     
00166     
00168     UDAT_NONE = -1,
00170     UDAT_IGNORE = -2
00171 
00172 } UDateFormatStyle;
00173 
00179 typedef enum UDateFormatField {
00185     UDAT_ERA_FIELD = 0,
00186 
00192     UDAT_YEAR_FIELD = 1,
00193 
00199     UDAT_MONTH_FIELD = 2,
00200 
00206     UDAT_DATE_FIELD = 3,
00207 
00215     UDAT_HOUR_OF_DAY1_FIELD = 4,
00216 
00224     UDAT_HOUR_OF_DAY0_FIELD = 5,
00225 
00231     UDAT_MINUTE_FIELD = 6,
00232 
00238     UDAT_SECOND_FIELD = 7,
00239 
00245     UDAT_FRACTIONAL_SECOND_FIELD = 8,
00246 
00252     UDAT_DAY_OF_WEEK_FIELD = 9,
00253 
00259     UDAT_DAY_OF_YEAR_FIELD = 10,
00260 
00266     UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11,
00267 
00273     UDAT_WEEK_OF_YEAR_FIELD = 12,
00274 
00280     UDAT_WEEK_OF_MONTH_FIELD = 13,
00281 
00287     UDAT_AM_PM_FIELD = 14,
00288 
00296     UDAT_HOUR1_FIELD = 15,
00297 
00305     UDAT_HOUR0_FIELD = 16,
00306 
00313     UDAT_TIMEZONE_FIELD = 17,
00314 
00320     UDAT_YEAR_WOY_FIELD = 18,
00321 
00327     UDAT_DOW_LOCAL_FIELD = 19,
00328 
00334     UDAT_EXTENDED_YEAR_FIELD = 20,
00335 
00341     UDAT_JULIAN_DAY_FIELD = 21,
00342 
00348     UDAT_MILLISECONDS_IN_DAY_FIELD = 22,
00349 
00356     UDAT_TIMEZONE_RFC_FIELD = 23,
00357 
00363     UDAT_TIMEZONE_GENERIC_FIELD = 24,
00370     UDAT_STANDALONE_DAY_FIELD = 25,
00371     
00378     UDAT_STANDALONE_MONTH_FIELD = 26,
00379 
00387     UDAT_QUARTER_FIELD = 27,
00388 
00396     UDAT_STANDALONE_QUARTER_FIELD = 28,
00397 
00403     UDAT_TIMEZONE_SPECIAL_FIELD = 29,
00404 
00413     UDAT_FIELD_COUNT = 30
00414 
00415 } UDateFormatField;
00416 
00436 U_STABLE UDateFormat* U_EXPORT2 
00437 udat_open(UDateFormatStyle  timeStyle,
00438           UDateFormatStyle  dateStyle,
00439           const char        *locale,
00440           const UChar       *tzID,
00441           int32_t           tzIDLength,
00442           const UChar       *pattern,
00443           int32_t           patternLength,
00444           UErrorCode        *status);
00445 
00446 
00453 U_STABLE void U_EXPORT2 
00454 udat_close(UDateFormat* format);
00455 
00464 U_STABLE UDateFormat* U_EXPORT2 
00465 udat_clone(const UDateFormat *fmt,
00466        UErrorCode *status);
00467 
00486 U_STABLE int32_t U_EXPORT2 
00487 udat_format(    const    UDateFormat*    format,
00488                         UDate           dateToFormat,
00489                         UChar*          result,
00490                         int32_t         resultLength,
00491                         UFieldPosition* position,
00492                         UErrorCode*     status);
00493 
00507 U_STABLE UDate U_EXPORT2 
00508 udat_parse(    const    UDateFormat*    format,
00509             const    UChar*          text,
00510                     int32_t         textLength,
00511                     int32_t         *parsePos,
00512                     UErrorCode      *status);
00513 
00527 U_STABLE void U_EXPORT2 
00528 udat_parseCalendar(const    UDateFormat*    format,
00529                             UCalendar*      calendar,
00530                    const    UChar*          text,
00531                             int32_t         textLength,
00532                             int32_t         *parsePos,
00533                             UErrorCode      *status);
00534 
00544 U_STABLE UBool U_EXPORT2 
00545 udat_isLenient(const UDateFormat* fmt);
00546 
00556 U_STABLE void U_EXPORT2 
00557 udat_setLenient(    UDateFormat*    fmt,
00558                     UBool          isLenient);
00559 
00569 U_STABLE const UCalendar* U_EXPORT2 
00570 udat_getCalendar(const UDateFormat* fmt);
00571 
00581 U_STABLE void U_EXPORT2 
00582 udat_setCalendar(            UDateFormat*    fmt,
00583                     const   UCalendar*      calendarToSet);
00584 
00594 U_STABLE const UNumberFormat* U_EXPORT2 
00595 udat_getNumberFormat(const UDateFormat* fmt);
00596 
00606 U_STABLE void U_EXPORT2 
00607 udat_setNumberFormat(            UDateFormat*    fmt,
00608                         const   UNumberFormat*  numberFormatToSet);
00609 
00619 U_STABLE const char* U_EXPORT2 
00620 udat_getAvailable(int32_t index);
00621 
00630 U_STABLE int32_t U_EXPORT2 
00631 udat_countAvailable(void);
00632 
00643 U_STABLE UDate U_EXPORT2 
00644 udat_get2DigitYearStart(    const   UDateFormat     *fmt,
00645                                     UErrorCode      *status);
00646 
00657 U_STABLE void U_EXPORT2 
00658 udat_set2DigitYearStart(    UDateFormat     *fmt,
00659                             UDate           d,
00660                             UErrorCode      *status);
00661 
00674 U_STABLE int32_t U_EXPORT2 
00675 udat_toPattern(    const   UDateFormat     *fmt,
00676                         UBool          localized,
00677                         UChar           *result,
00678                         int32_t         resultLength,
00679                         UErrorCode      *status);
00680 
00691 U_STABLE void U_EXPORT2 
00692 udat_applyPattern(            UDateFormat     *format,
00693                             UBool          localized,
00694                     const   UChar           *pattern,
00695                             int32_t         patternLength);
00696 
00701 typedef enum UDateFormatSymbolType {
00703     UDAT_ERAS,
00705     UDAT_MONTHS,
00707     UDAT_SHORT_MONTHS,
00709     UDAT_WEEKDAYS,
00711     UDAT_SHORT_WEEKDAYS,
00713     UDAT_AM_PMS,
00715     UDAT_LOCALIZED_CHARS,
00717     UDAT_ERA_NAMES,
00719     UDAT_NARROW_MONTHS,
00721     UDAT_NARROW_WEEKDAYS,
00723     UDAT_STANDALONE_MONTHS,
00724     UDAT_STANDALONE_SHORT_MONTHS,
00725     UDAT_STANDALONE_NARROW_MONTHS,
00727     UDAT_STANDALONE_WEEKDAYS,
00728     UDAT_STANDALONE_SHORT_WEEKDAYS,
00729     UDAT_STANDALONE_NARROW_WEEKDAYS,
00731     UDAT_QUARTERS,
00733     UDAT_SHORT_QUARTERS,
00735     UDAT_STANDALONE_QUARTERS,
00736     UDAT_STANDALONE_SHORT_QUARTERS
00737 
00738 } UDateFormatSymbolType;
00739 
00740 struct UDateFormatSymbols;
00745 typedef struct UDateFormatSymbols UDateFormatSymbols;
00746 
00763 U_STABLE int32_t U_EXPORT2 
00764 udat_getSymbols(const   UDateFormat             *fmt,
00765                         UDateFormatSymbolType   type,
00766                         int32_t                 index,
00767                         UChar                   *result,
00768                         int32_t                 resultLength,
00769                         UErrorCode              *status);
00770 
00783 U_STABLE int32_t U_EXPORT2 
00784 udat_countSymbols(    const    UDateFormat                *fmt,
00785                             UDateFormatSymbolType    type);
00786 
00802 U_STABLE void U_EXPORT2 
00803 udat_setSymbols(    UDateFormat             *format,
00804                     UDateFormatSymbolType   type,
00805                     int32_t                 index,
00806                     UChar                   *value,
00807                     int32_t                 valueLength,
00808                     UErrorCode              *status);
00809 
00819 U_STABLE const char* U_EXPORT2
00820 udat_getLocaleByType(const UDateFormat *fmt,
00821                      ULocDataLocaleType type,
00822                      UErrorCode* status); 
00823 
00824 #endif /* #if !UCONFIG_NO_FORMATTING */
00825 
00826 #endif

Generated on Fri Jan 25 08:31:03 2008 for ICU 3.8 by  doxygen 1.5.4