ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
udat.h
Go to the documentation of this file.
1 /*
2  *******************************************************************************
3  * Copyright (C) 1996-2010, International Business Machines
4  * Corporation and others. All Rights Reserved.
5  *******************************************************************************
6 */
7 
8 #ifndef UDAT_H
9 #define UDAT_H
10 
11 #include "unicode/utypes.h"
12 
13 #if !UCONFIG_NO_FORMATTING
14 
15 #include "unicode/localpointer.h"
16 #include "unicode/ucal.h"
17 #include "unicode/unum.h"
139 typedef void* UDateFormat;
140 
144 typedef enum UDateFormatStyle {
155 
157  UDAT_RELATIVE = (1 << 7),
158 
159  UDAT_FULL_RELATIVE = UDAT_FULL | UDAT_RELATIVE,
160 
161  UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE,
162 
163  UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE,
164 
165  UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE,
166 
167 
169  UDAT_NONE = -1,
172 
174 
175 
207 #define UDAT_MINUTE_SECOND "ms"
208 #define UDAT_HOUR24_MINUTE "Hm"
209 #define UDAT_HOUR24_MINUTE_SECOND "Hms"
210 #define UDAT_HOUR_MINUTE_SECOND "hms"
211 #define UDAT_STANDALONE_MONTH "LLLL"
212 #define UDAT_ABBR_STANDALONE_MONTH "LLL"
213 #define UDAT_YEAR_QUARTER "yQQQ"
214 #define UDAT_YEAR_ABBR_QUARTER "yQ"
215 
226 #define UDAT_HOUR_MINUTE "hm"
227 #define UDAT_YEAR "y"
228 #define UDAT_DAY "d"
229 #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd"
230 #define UDAT_YEAR_NUM_MONTH "yM"
231 #define UDAT_NUM_MONTH_DAY "Md"
232 #define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd"
233 #define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd"
234 #define UDAT_YEAR_MONTH "yMMMM"
235 #define UDAT_YEAR_ABBR_MONTH "yMMM"
236 #define UDAT_MONTH_DAY "MMMMd"
237 #define UDAT_ABBR_MONTH_DAY "MMMd"
238 #define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd"
239 #define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
240 #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd"
241 #define UDAT_YEAR_MONTH_DAY "yMMMMd"
242 #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd"
243 #define UDAT_YEAR_NUM_MONTH_DAY "yMd"
244 #define UDAT_NUM_MONTH "M"
245 #define UDAT_ABBR_MONTH "MMM"
246 #define UDAT_MONTH "MMMM"
247 #define UDAT_HOUR_MINUTE_GENERIC_TZ "hmv"
248 #define UDAT_HOUR_MINUTE_TZ "hmz"
249 #define UDAT_HOUR "h"
250 #define UDAT_HOUR_GENERIC_TZ "hv"
251 #define UDAT_HOUR_TZ "hz"
252 
261 typedef enum UDateFormatField {
268 
275 
282 
289 
298 
307 
314 
321 
328 
335 
342 
349 
356 
363 
370 
379 
388 
396 
403 
410 
417 
424 
431 
439 
453 
461 
470 
479 
486 
496 
498 
499 
510 
511 
534 udat_open(UDateFormatStyle timeStyle,
535  UDateFormatStyle dateStyle,
536  const char *locale,
537  const UChar *tzID,
538  int32_t tzIDLength,
539  const UChar *pattern,
540  int32_t patternLength,
541  UErrorCode *status);
542 
543 
550 U_STABLE void U_EXPORT2
551 udat_close(UDateFormat* format);
552 
553 #if U_SHOW_CPLUSPLUS_API
554 
556 
566 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateFormatPointer, UDateFormat, udat_close);
567 
569 
570 #endif
571 
581 udat_clone(const UDateFormat *fmt,
582  UErrorCode *status);
583 
602 U_STABLE int32_t U_EXPORT2
603 udat_format( const UDateFormat* format,
604  UDate dateToFormat,
605  UChar* result,
606  int32_t resultLength,
607  UFieldPosition* position,
608  UErrorCode* status);
609 
624 udat_parse( const UDateFormat* format,
625  const UChar* text,
626  int32_t textLength,
627  int32_t *parsePos,
628  UErrorCode *status);
629 
643 U_STABLE void U_EXPORT2
644 udat_parseCalendar(const UDateFormat* format,
645  UCalendar* calendar,
646  const UChar* text,
647  int32_t textLength,
648  int32_t *parsePos,
649  UErrorCode *status);
650 
661 udat_isLenient(const UDateFormat* fmt);
662 
672 U_STABLE void U_EXPORT2
674  UBool isLenient);
675 
686 udat_getCalendar(const UDateFormat* fmt);
687 
697 U_STABLE void U_EXPORT2
699  const UCalendar* calendarToSet);
700 
712 
722 U_STABLE void U_EXPORT2
724  const UNumberFormat* numberFormatToSet);
725 
735 U_STABLE const char* U_EXPORT2
736 udat_getAvailable(int32_t localeIndex);
737 
746 U_STABLE int32_t U_EXPORT2
747 udat_countAvailable(void);
748 
761  UErrorCode *status);
762 
773 U_STABLE void U_EXPORT2
775  UDate d,
776  UErrorCode *status);
777 
790 U_STABLE int32_t U_EXPORT2
791 udat_toPattern( const UDateFormat *fmt,
792  UBool localized,
793  UChar *result,
794  int32_t resultLength,
795  UErrorCode *status);
796 
807 U_STABLE void U_EXPORT2
809  UBool localized,
810  const UChar *pattern,
811  int32_t patternLength);
812 
817 typedef enum UDateFormatSymbolType {
840  UDAT_STANDALONE_SHORT_MONTHS,
841  UDAT_STANDALONE_NARROW_MONTHS,
844  UDAT_STANDALONE_SHORT_WEEKDAYS,
845  UDAT_STANDALONE_NARROW_WEEKDAYS,
852  UDAT_STANDALONE_SHORT_QUARTERS
853 
855 
856 struct UDateFormatSymbols;
862 
879 U_STABLE int32_t U_EXPORT2
880 udat_getSymbols(const UDateFormat *fmt,
882  int32_t symbolIndex,
883  UChar *result,
884  int32_t resultLength,
885  UErrorCode *status);
886 
899 U_STABLE int32_t U_EXPORT2
900 udat_countSymbols( const UDateFormat *fmt,
901  UDateFormatSymbolType type);
902 
918 U_STABLE void U_EXPORT2
921  int32_t symbolIndex,
922  UChar *value,
923  int32_t valueLength,
924  UErrorCode *status);
925 
935 U_STABLE const char* U_EXPORT2
937  ULocDataLocaleType type,
938  UErrorCode* status);
939 
951 U_INTERNAL int32_t U_EXPORT2
953  UChar *result,
954  int32_t resultLength,
955  UErrorCode *status);
956 
968 U_INTERNAL int32_t U_EXPORT2
970  UChar *result,
971  int32_t resultLength,
972  UErrorCode *status);
973 
986 U_INTERNAL void U_EXPORT2
988  const UChar *datePattern,
989  int32_t datePatternLength,
990  const UChar *timePattern,
991  int32_t timePatternLength,
992  UErrorCode *status);
993 
994 
995 #endif /* #if !UCONFIG_NO_FORMATTING */
996 
997 #endif