2 *******************************************************************************
3 * Copyright (C) 1996-2006, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 *******************************************************************************
8 #include "unicode/utypes.h"
10 #if !UCONFIG_NO_FORMATTING
12 #include "unicode/udat.h"
14 #include "unicode/uloc.h"
15 #include "unicode/datefmt.h"
16 #include "unicode/timezone.h"
17 #include "unicode/smpdtfmt.h"
18 #include "unicode/fieldpos.h"
19 #include "unicode/parsepos.h"
20 #include "unicode/calendar.h"
21 #include "unicode/numfmt.h"
22 #include "unicode/dtfmtsym.h"
23 #include "unicode/ustring.h"
28 U_CAPI UDateFormat
* U_EXPORT2
29 udat_open(UDateFormatStyle timeStyle
,
30 UDateFormatStyle dateStyle
,
35 int32_t patternLength
,
39 if(U_FAILURE(*status
)) {
42 if(timeStyle
!= UDAT_IGNORE
) {
44 fmt
= DateFormat::createDateTimeInstance((DateFormat::EStyle
)dateStyle
,
45 (DateFormat::EStyle
)timeStyle
);
48 fmt
= DateFormat::createDateTimeInstance((DateFormat::EStyle
)dateStyle
,
49 (DateFormat::EStyle
)timeStyle
,
54 UnicodeString
pat((UBool
)(patternLength
== -1), pattern
, patternLength
);
57 fmt
= new SimpleDateFormat(pat
, *status
);
60 fmt
= new SimpleDateFormat(pat
, Locale(locale
), *status
);
65 *status
= U_MEMORY_ALLOCATION_ERROR
;
70 TimeZone
*zone
= TimeZone::createTimeZone(UnicodeString((UBool
)(tzIDLength
== -1), tzID
, tzIDLength
));
72 *status
= U_MEMORY_ALLOCATION_ERROR
;
76 fmt
->adoptTimeZone(zone
);
79 return (UDateFormat
*)fmt
;
84 udat_close(UDateFormat
* format
)
86 delete (DateFormat
*)format
;
89 U_CAPI UDateFormat
* U_EXPORT2
90 udat_clone(const UDateFormat
*fmt
,
93 if(U_FAILURE(*status
)) return 0;
95 Format
*res
= ((SimpleDateFormat
*)fmt
)->clone();
98 *status
= U_MEMORY_ALLOCATION_ERROR
;
102 return (UDateFormat
*) res
;
105 U_CAPI
int32_t U_EXPORT2
106 udat_format( const UDateFormat
* format
,
109 int32_t resultLength
,
110 UFieldPosition
* position
,
113 if(U_FAILURE(*status
)) return -1;
116 if(!(result
==NULL
&& resultLength
==0)) {
117 // NULL destination for pure preflighting: empty dummy string
118 // otherwise, alias the destination buffer
119 res
.setTo(result
, 0, resultLength
);
125 fp
.setField(position
->field
);
127 ((DateFormat
*)format
)->format(dateToFormat
, res
, fp
);
130 position
->beginIndex
= fp
.getBeginIndex();
131 position
->endIndex
= fp
.getEndIndex();
134 return res
.extract(result
, resultLength
, *status
);
137 U_CAPI UDate U_EXPORT2
138 udat_parse( const UDateFormat
* format
,
144 if(U_FAILURE(*status
)) return (UDate
)0;
146 const UnicodeString
src((UBool
)(textLength
== -1), text
, textLength
);
148 int32_t stackParsePos
= 0;
151 if(parsePos
== NULL
) {
152 parsePos
= &stackParsePos
;
155 pp
.setIndex(*parsePos
);
157 res
= ((DateFormat
*)format
)->parse(src
, pp
);
159 if(pp
.getErrorIndex() == -1)
160 *parsePos
= pp
.getIndex();
162 *parsePos
= pp
.getErrorIndex();
163 *status
= U_PARSE_ERROR
;
169 U_CAPI
void U_EXPORT2
170 udat_parseCalendar(const UDateFormat
* format
,
177 if(U_FAILURE(*status
)) return;
179 const UnicodeString
src((UBool
)(textLength
== -1), text
, textLength
);
183 pp
.setIndex(*parsePos
);
185 ((DateFormat
*)format
)->parse(src
, *(Calendar
*)calendar
, pp
);
188 if(pp
.getErrorIndex() == -1)
189 *parsePos
= pp
.getIndex();
191 *parsePos
= pp
.getErrorIndex();
192 *status
= U_PARSE_ERROR
;
197 U_CAPI UBool U_EXPORT2
198 udat_isLenient(const UDateFormat
* fmt
)
200 return ((DateFormat
*)fmt
)->isLenient();
203 U_CAPI
void U_EXPORT2
204 udat_setLenient( UDateFormat
* fmt
,
207 ((DateFormat
*)fmt
)->setLenient(isLenient
);
210 U_CAPI
const UCalendar
* U_EXPORT2
211 udat_getCalendar(const UDateFormat
* fmt
)
213 return (const UCalendar
*) ((DateFormat
*)fmt
)->getCalendar();
216 U_CAPI
void U_EXPORT2
217 udat_setCalendar(UDateFormat
* fmt
,
218 const UCalendar
* calendarToSet
)
220 ((DateFormat
*)fmt
)->setCalendar(*((Calendar
*)calendarToSet
));
223 U_CAPI
const UNumberFormat
* U_EXPORT2
224 udat_getNumberFormat(const UDateFormat
* fmt
)
226 return (const UNumberFormat
*) ((DateFormat
*)fmt
)->getNumberFormat();
229 U_CAPI
void U_EXPORT2
230 udat_setNumberFormat(UDateFormat
* fmt
,
231 const UNumberFormat
* numberFormatToSet
)
233 ((DateFormat
*)fmt
)->setNumberFormat(*((NumberFormat
*)numberFormatToSet
));
236 U_CAPI
const char* U_EXPORT2
237 udat_getAvailable(int32_t index
)
239 return uloc_getAvailable(index
);
242 U_CAPI
int32_t U_EXPORT2
243 udat_countAvailable()
245 return uloc_countAvailable();
248 U_CAPI UDate U_EXPORT2
249 udat_get2DigitYearStart( const UDateFormat
*fmt
,
252 if(U_FAILURE(*status
)) return (UDate
)0;
253 return ((SimpleDateFormat
*)fmt
)->get2DigitYearStart(*status
);
256 U_CAPI
void U_EXPORT2
257 udat_set2DigitYearStart( UDateFormat
*fmt
,
261 if(U_FAILURE(*status
)) return;
262 ((SimpleDateFormat
*)fmt
)->set2DigitYearStart(d
, *status
);
265 U_CAPI
int32_t U_EXPORT2
266 udat_toPattern( const UDateFormat
*fmt
,
269 int32_t resultLength
,
272 if(U_FAILURE(*status
)) return -1;
275 if(!(result
==NULL
&& resultLength
==0)) {
276 // NULL destination for pure preflighting: empty dummy string
277 // otherwise, alias the destination buffer
278 res
.setTo(result
, 0, resultLength
);
282 ((SimpleDateFormat
*)fmt
)->toLocalizedPattern(res
, *status
);
284 ((SimpleDateFormat
*)fmt
)->toPattern(res
);
286 return res
.extract(result
, resultLength
, *status
);
289 // TBD: should this take an UErrorCode?
290 U_CAPI
void U_EXPORT2
291 udat_applyPattern( UDateFormat
*format
,
293 const UChar
*pattern
,
294 int32_t patternLength
)
296 const UnicodeString
pat((UBool
)(patternLength
== -1), pattern
, patternLength
);
297 UErrorCode status
= U_ZERO_ERROR
;
300 ((SimpleDateFormat
*)format
)->applyLocalizedPattern(pat
, status
);
302 ((SimpleDateFormat
*)format
)->applyPattern(pat
);
305 U_CAPI
int32_t U_EXPORT2
306 udat_getSymbols(const UDateFormat
*fmt
,
307 UDateFormatSymbolType type
,
310 int32_t resultLength
,
313 if(U_FAILURE(*status
)) return -1;
315 const DateFormatSymbols
*syms
=
316 ((SimpleDateFormat
*)fmt
)->getDateFormatSymbols();
318 const UnicodeString
*res
= NULL
;
322 res
= syms
->getEras(count
);
326 res
= syms
->getEraNames(count
);
330 res
= syms
->getMonths(count
);
333 case UDAT_SHORT_MONTHS
:
334 res
= syms
->getShortMonths(count
);
338 res
= syms
->getWeekdays(count
);
341 case UDAT_SHORT_WEEKDAYS
:
342 res
= syms
->getShortWeekdays(count
);
346 res
= syms
->getAmPmStrings(count
);
349 case UDAT_LOCALIZED_CHARS
:
352 if(!(result
==NULL
&& resultLength
==0)) {
353 // NULL destination for pure preflighting: empty dummy string
354 // otherwise, alias the destination buffer
355 res1
.setTo(result
, 0, resultLength
);
357 syms
->getLocalPatternChars(res1
);
358 return res1
.extract(result
, resultLength
, *status
);
361 case UDAT_NARROW_MONTHS
:
362 res
= syms
->getMonths(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::NARROW
);
365 case UDAT_NARROW_WEEKDAYS
:
366 res
= syms
->getWeekdays(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::NARROW
);
369 case UDAT_STANDALONE_MONTHS
:
370 res
= syms
->getMonths(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::WIDE
);
373 case UDAT_STANDALONE_SHORT_MONTHS
:
374 res
= syms
->getMonths(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::ABBREVIATED
);
377 case UDAT_STANDALONE_NARROW_MONTHS
:
378 res
= syms
->getMonths(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::NARROW
);
381 case UDAT_STANDALONE_WEEKDAYS
:
382 res
= syms
->getWeekdays(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::WIDE
);
385 case UDAT_STANDALONE_SHORT_WEEKDAYS
:
386 res
= syms
->getWeekdays(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::ABBREVIATED
);
389 case UDAT_STANDALONE_NARROW_WEEKDAYS
:
390 res
= syms
->getWeekdays(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::NARROW
);
394 res
= syms
->getQuarters(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::WIDE
);
397 case UDAT_SHORT_QUARTERS
:
398 res
= syms
->getQuarters(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::ABBREVIATED
);
401 case UDAT_STANDALONE_QUARTERS
:
402 res
= syms
->getQuarters(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::WIDE
);
405 case UDAT_STANDALONE_SHORT_QUARTERS
:
406 res
= syms
->getQuarters(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::ABBREVIATED
);
412 return res
[index
].extract(result
, resultLength
, *status
);
417 U_CAPI
int32_t U_EXPORT2
418 udat_countSymbols( const UDateFormat
*fmt
,
419 UDateFormatSymbolType type
)
421 const DateFormatSymbols
*syms
=
422 ((SimpleDateFormat
*)fmt
)->getDateFormatSymbols();
427 syms
->getEras(count
);
431 syms
->getMonths(count
);
434 case UDAT_SHORT_MONTHS
:
435 syms
->getShortMonths(count
);
439 syms
->getWeekdays(count
);
442 case UDAT_SHORT_WEEKDAYS
:
443 syms
->getShortWeekdays(count
);
447 syms
->getAmPmStrings(count
);
450 case UDAT_LOCALIZED_CHARS
:
455 syms
->getEraNames(count
);
458 case UDAT_NARROW_MONTHS
:
459 syms
->getMonths(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::NARROW
);
462 case UDAT_NARROW_WEEKDAYS
:
463 syms
->getWeekdays(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::NARROW
);
466 case UDAT_STANDALONE_MONTHS
:
467 syms
->getMonths(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::WIDE
);
470 case UDAT_STANDALONE_SHORT_MONTHS
:
471 syms
->getMonths(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::ABBREVIATED
);
474 case UDAT_STANDALONE_NARROW_MONTHS
:
475 syms
->getMonths(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::NARROW
);
478 case UDAT_STANDALONE_WEEKDAYS
:
479 syms
->getWeekdays(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::WIDE
);
482 case UDAT_STANDALONE_SHORT_WEEKDAYS
:
483 syms
->getWeekdays(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::ABBREVIATED
);
486 case UDAT_STANDALONE_NARROW_WEEKDAYS
:
487 syms
->getWeekdays(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::NARROW
);
491 syms
->getQuarters(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::WIDE
);
494 case UDAT_SHORT_QUARTERS
:
495 syms
->getQuarters(count
, DateFormatSymbols::FORMAT
, DateFormatSymbols::ABBREVIATED
);
498 case UDAT_STANDALONE_QUARTERS
:
499 syms
->getQuarters(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::WIDE
);
502 case UDAT_STANDALONE_SHORT_QUARTERS
:
503 syms
->getQuarters(count
, DateFormatSymbols::STANDALONE
, DateFormatSymbols::ABBREVIATED
);
514 * This DateFormatSymbolsSingleSetter class is a friend of DateFormatSymbols
515 * solely for the purpose of avoiding to clone the array of strings
516 * just to modify one of them and then setting all of them back.
517 * For example, the old code looked like this:
519 * res = syms->getMonths(count);
520 * array = new UnicodeString[count];
522 * *status = U_MEMORY_ALLOCATION_ERROR;
525 * uprv_arrayCopy(res, array, count);
527 * array[index] = val;
528 * syms->setMonths(array, count);
531 * Even worse, the old code actually cloned the entire DateFormatSymbols object,
532 * cloned one value array, changed one value, and then made the SimpleDateFormat
533 * replace its DateFormatSymbols object with the new one.
537 class DateFormatSymbolsSingleSetter
/* not : public UObject because all methods are static */ {
540 setSymbol(UnicodeString
*array
, int32_t count
, int32_t index
,
541 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
545 errorCode
=U_INDEX_OUTOFBOUNDS_ERROR
;
546 } else if(value
==NULL
) {
547 errorCode
=U_ILLEGAL_ARGUMENT_ERROR
;
549 array
[index
].setTo(value
, valueLength
);
555 setEra(DateFormatSymbols
*syms
, int32_t index
,
556 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
558 setSymbol(syms
->fEras
, syms
->fErasCount
, index
, value
, valueLength
, errorCode
);
562 setEraName(DateFormatSymbols
*syms
, int32_t index
,
563 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
565 setSymbol(syms
->fEraNames
, syms
->fEraNamesCount
, index
, value
, valueLength
, errorCode
);
569 setMonth(DateFormatSymbols
*syms
, int32_t index
,
570 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
572 setSymbol(syms
->fMonths
, syms
->fMonthsCount
, index
, value
, valueLength
, errorCode
);
576 setShortMonth(DateFormatSymbols
*syms
, int32_t index
,
577 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
579 setSymbol(syms
->fShortMonths
, syms
->fShortMonthsCount
, index
, value
, valueLength
, errorCode
);
583 setNarrowMonth(DateFormatSymbols
*syms
, int32_t index
,
584 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
586 setSymbol(syms
->fNarrowMonths
, syms
->fNarrowMonthsCount
, index
, value
, valueLength
, errorCode
);
590 setStandaloneMonth(DateFormatSymbols
*syms
, int32_t index
,
591 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
593 setSymbol(syms
->fStandaloneMonths
, syms
->fStandaloneMonthsCount
, index
, value
, valueLength
, errorCode
);
597 setStandaloneShortMonth(DateFormatSymbols
*syms
, int32_t index
,
598 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
600 setSymbol(syms
->fStandaloneShortMonths
, syms
->fStandaloneShortMonthsCount
, index
, value
, valueLength
, errorCode
);
604 setStandaloneNarrowMonth(DateFormatSymbols
*syms
, int32_t index
,
605 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
607 setSymbol(syms
->fStandaloneNarrowMonths
, syms
->fStandaloneNarrowMonthsCount
, index
, value
, valueLength
, errorCode
);
611 setWeekday(DateFormatSymbols
*syms
, int32_t index
,
612 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
614 setSymbol(syms
->fWeekdays
, syms
->fWeekdaysCount
, index
, value
, valueLength
, errorCode
);
618 setShortWeekday(DateFormatSymbols
*syms
, int32_t index
,
619 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
621 setSymbol(syms
->fShortWeekdays
, syms
->fShortWeekdaysCount
, index
, value
, valueLength
, errorCode
);
625 setNarrowWeekday(DateFormatSymbols
*syms
, int32_t index
,
626 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
628 setSymbol(syms
->fNarrowWeekdays
, syms
->fNarrowWeekdaysCount
, index
, value
, valueLength
, errorCode
);
632 setStandaloneWeekday(DateFormatSymbols
*syms
, int32_t index
,
633 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
635 setSymbol(syms
->fStandaloneWeekdays
, syms
->fStandaloneWeekdaysCount
, index
, value
, valueLength
, errorCode
);
639 setStandaloneShortWeekday(DateFormatSymbols
*syms
, int32_t index
,
640 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
642 setSymbol(syms
->fStandaloneShortWeekdays
, syms
->fStandaloneShortWeekdaysCount
, index
, value
, valueLength
, errorCode
);
646 setStandaloneNarrowWeekday(DateFormatSymbols
*syms
, int32_t index
,
647 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
649 setSymbol(syms
->fStandaloneNarrowWeekdays
, syms
->fStandaloneNarrowWeekdaysCount
, index
, value
, valueLength
, errorCode
);
653 setQuarter(DateFormatSymbols
*syms
, int32_t index
,
654 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
656 setSymbol(syms
->fQuarters
, syms
->fQuartersCount
, index
, value
, valueLength
, errorCode
);
660 setShortQuarter(DateFormatSymbols
*syms
, int32_t index
,
661 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
663 setSymbol(syms
->fShortQuarters
, syms
->fShortQuartersCount
, index
, value
, valueLength
, errorCode
);
667 setStandaloneQuarter(DateFormatSymbols
*syms
, int32_t index
,
668 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
670 setSymbol(syms
->fStandaloneQuarters
, syms
->fStandaloneQuartersCount
, index
, value
, valueLength
, errorCode
);
674 setStandaloneShortQuarter(DateFormatSymbols
*syms
, int32_t index
,
675 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
677 setSymbol(syms
->fStandaloneShortQuarters
, syms
->fStandaloneShortQuartersCount
, index
, value
, valueLength
, errorCode
);
681 setAmPm(DateFormatSymbols
*syms
, int32_t index
,
682 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
684 setSymbol(syms
->fAmPms
, syms
->fAmPmsCount
, index
, value
, valueLength
, errorCode
);
688 setLocalPatternChars(DateFormatSymbols
*syms
,
689 const UChar
*value
, int32_t valueLength
, UErrorCode
&errorCode
)
691 setSymbol(&syms
->fLocalPatternChars
, 1, 0, value
, valueLength
, errorCode
);
697 U_CAPI
void U_EXPORT2
698 udat_setSymbols( UDateFormat
*format
,
699 UDateFormatSymbolType type
,
706 if(U_FAILURE(*status
)) return;
708 DateFormatSymbols
*syms
= (DateFormatSymbols
*)((SimpleDateFormat
*)format
)->getDateFormatSymbols();
712 DateFormatSymbolsSingleSetter::setEra(syms
, index
, value
, valueLength
, *status
);
716 DateFormatSymbolsSingleSetter::setEraName(syms
, index
, value
, valueLength
, *status
);
720 DateFormatSymbolsSingleSetter::setMonth(syms
, index
, value
, valueLength
, *status
);
723 case UDAT_SHORT_MONTHS
:
724 DateFormatSymbolsSingleSetter::setShortMonth(syms
, index
, value
, valueLength
, *status
);
727 case UDAT_NARROW_MONTHS
:
728 DateFormatSymbolsSingleSetter::setNarrowMonth(syms
, index
, value
, valueLength
, *status
);
731 case UDAT_STANDALONE_MONTHS
:
732 DateFormatSymbolsSingleSetter::setStandaloneMonth(syms
, index
, value
, valueLength
, *status
);
735 case UDAT_STANDALONE_SHORT_MONTHS
:
736 DateFormatSymbolsSingleSetter::setStandaloneShortMonth(syms
, index
, value
, valueLength
, *status
);
739 case UDAT_STANDALONE_NARROW_MONTHS
:
740 DateFormatSymbolsSingleSetter::setStandaloneNarrowMonth(syms
, index
, value
, valueLength
, *status
);
744 DateFormatSymbolsSingleSetter::setWeekday(syms
, index
, value
, valueLength
, *status
);
747 case UDAT_SHORT_WEEKDAYS
:
748 DateFormatSymbolsSingleSetter::setShortWeekday(syms
, index
, value
, valueLength
, *status
);
751 case UDAT_NARROW_WEEKDAYS
:
752 DateFormatSymbolsSingleSetter::setNarrowWeekday(syms
, index
, value
, valueLength
, *status
);
755 case UDAT_STANDALONE_WEEKDAYS
:
756 DateFormatSymbolsSingleSetter::setStandaloneWeekday(syms
, index
, value
, valueLength
, *status
);
759 case UDAT_STANDALONE_SHORT_WEEKDAYS
:
760 DateFormatSymbolsSingleSetter::setStandaloneShortWeekday(syms
, index
, value
, valueLength
, *status
);
763 case UDAT_STANDALONE_NARROW_WEEKDAYS
:
764 DateFormatSymbolsSingleSetter::setStandaloneNarrowWeekday(syms
, index
, value
, valueLength
, *status
);
768 DateFormatSymbolsSingleSetter::setQuarter(syms
, index
, value
, valueLength
, *status
);
771 case UDAT_SHORT_QUARTERS
:
772 DateFormatSymbolsSingleSetter::setShortQuarter(syms
, index
, value
, valueLength
, *status
);
775 case UDAT_STANDALONE_QUARTERS
:
776 DateFormatSymbolsSingleSetter::setStandaloneQuarter(syms
, index
, value
, valueLength
, *status
);
779 case UDAT_STANDALONE_SHORT_QUARTERS
:
780 DateFormatSymbolsSingleSetter::setStandaloneShortQuarter(syms
, index
, value
, valueLength
, *status
);
784 DateFormatSymbolsSingleSetter::setAmPm(syms
, index
, value
, valueLength
, *status
);
787 case UDAT_LOCALIZED_CHARS
:
788 DateFormatSymbolsSingleSetter::setLocalPatternChars(syms
, value
, valueLength
, *status
);
792 *status
= U_UNSUPPORTED_ERROR
;
798 U_CAPI
const char* U_EXPORT2
799 udat_getLocaleByType(const UDateFormat
*fmt
,
800 ULocDataLocaleType type
,
804 if (U_SUCCESS(*status
)) {
805 *status
= U_ILLEGAL_ARGUMENT_ERROR
;
809 return ((Format
*)fmt
)->getLocaleID(type
, *status
);
811 #endif /* #if !UCONFIG_NO_FORMATTING */