2 ********************************************************************************
3 * Copyright (C) 1997-2013, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ********************************************************************************
9 * Modification History:
11 * Date Name Description
12 * 02/19/97 aliu Converted from java.
13 * 07/21/98 stephen Added getZoneIndex()
14 * Changed to match C++ conventions
15 ********************************************************************************
21 #include "unicode/utypes.h"
23 #if !UCONFIG_NO_FORMATTING
25 #include "unicode/calendar.h"
26 #include "unicode/uobject.h"
27 #include "unicode/locid.h"
28 #include "unicode/udat.h"
29 #include "unicode/ures.h"
33 * \brief C++ API: Symbols for formatting dates.
38 /* forward declaration */
39 class SimpleDateFormat
;
43 * DateFormatSymbols is a public class for encapsulating localizable date-time
44 * formatting data -- including timezone data. DateFormatSymbols is used by
45 * DateFormat and SimpleDateFormat.
47 * Rather than first creating a DateFormatSymbols to get a date-time formatter
48 * by using a SimpleDateFormat constructor, clients are encouraged to create a
49 * date-time formatter using the getTimeInstance(), getDateInstance(), or
50 * getDateTimeInstance() method in DateFormat. Each of these methods can return a
51 * date/time formatter initialized with a default format pattern along with the
52 * date-time formatting data for a given or default locale. After a formatter is
53 * created, clients may modify the format pattern using the setPattern function
54 * as so desired. For more information on using these formatter factory
55 * functions, see DateFormat.
57 * If clients decide to create a date-time formatter with a particular format
58 * pattern and locale, they can do so with new SimpleDateFormat(aPattern,
59 * new DateFormatSymbols(aLocale)). This will load the appropriate date-time
60 * formatting data from the locale.
62 * DateFormatSymbols objects are clonable. When clients obtain a
63 * DateFormatSymbols object, they can feel free to modify the date-time
64 * formatting data as necessary. For instance, clients can
65 * replace the localized date-time format pattern characters with the ones that
66 * they feel easy to remember. Or they can change the representative cities
67 * originally picked by default to using their favorite ones.
69 * DateFormatSymbols are not expected to be subclassed. Data for a calendar is
70 * loaded out of resource bundles. The 'type' parameter indicates the type of
71 * calendar, for example, "gregorian" or "japanese". If the type is not gregorian
72 * (or NULL, or an empty string) then the type is appended to the resource name,
73 * for example, 'Eras_japanese' instead of 'Eras'. If the resource 'Eras_japanese' did
74 * not exist (even in root), then this class will fall back to just 'Eras', that is,
75 * Gregorian data. Therefore, the calendar implementor MUST ensure that the root
76 * locale at least contains any resources that are to be particularized for the
79 class U_I18N_API DateFormatSymbols
: public UObject
{
82 * Construct a DateFormatSymbols object by loading format data from
83 * resources for the default locale, in the default calendar (Gregorian).
85 * NOTE: This constructor will never fail; if it cannot get resource
86 * data for the default locale, it will return a last-resort object
87 * based on hard-coded strings.
89 * @param status Status code. Failure
90 * results if the resources for the default cannot be
91 * found or cannot be loaded
94 DateFormatSymbols(UErrorCode
& status
);
97 * Construct a DateFormatSymbols object by loading format data from
98 * resources for the given locale, in the default calendar (Gregorian).
100 * @param locale Locale to load format data from.
101 * @param status Status code. Failure
102 * results if the resources for the locale cannot be
103 * found or cannot be loaded
106 DateFormatSymbols(const Locale
& locale
,
109 #ifndef U_HIDE_INTERNAL_API
111 * Construct a DateFormatSymbols object by loading format data from
112 * resources for the default locale, in the default calendar (Gregorian).
114 * NOTE: This constructor will never fail; if it cannot get resource
115 * data for the default locale, it will return a last-resort object
116 * based on hard-coded strings.
118 * @param type Type of calendar (as returned by Calendar::getType).
119 * Will be used to access the correct set of strings.
120 * (NULL or empty string defaults to "gregorian".)
121 * @param status Status code. Failure
122 * results if the resources for the default cannot be
123 * found or cannot be loaded
126 DateFormatSymbols(const char *type
, UErrorCode
& status
);
129 * Construct a DateFormatSymbols object by loading format data from
130 * resources for the given locale, in the default calendar (Gregorian).
132 * @param locale Locale to load format data from.
133 * @param type Type of calendar (as returned by Calendar::getType).
134 * Will be used to access the correct set of strings.
135 * (NULL or empty string defaults to "gregorian".)
136 * @param status Status code. Failure
137 * results if the resources for the locale cannot be
138 * found or cannot be loaded
141 DateFormatSymbols(const Locale
& locale
,
144 #endif /* U_HIDE_INTERNAL_API */
150 DateFormatSymbols(const DateFormatSymbols
&);
153 * Assignment operator.
156 DateFormatSymbols
& operator=(const DateFormatSymbols
&);
159 * Destructor. This is nonvirtual because this class is not designed to be
163 virtual ~DateFormatSymbols();
166 * Return true if another object is semantically equal to this one.
168 * @param other the DateFormatSymbols object to be compared with.
169 * @return true if other is semantically equal to this.
172 UBool
operator==(const DateFormatSymbols
& other
) const;
175 * Return true if another object is semantically unequal to this one.
177 * @param other the DateFormatSymbols object to be compared with.
178 * @return true if other is semantically unequal to this.
181 UBool
operator!=(const DateFormatSymbols
& other
) const { return !operator==(other
); }
184 * Gets abbreviated era strings. For example: "AD" and "BC".
186 * @param count Filled in with length of the array.
187 * @return the era strings.
190 const UnicodeString
* getEras(int32_t& count
) const;
193 * Sets abbreviated era strings. For example: "AD" and "BC".
194 * @param eras Array of era strings (DateFormatSymbols retains ownership.)
195 * @param count Filled in with length of the array.
198 void setEras(const UnicodeString
* eras
, int32_t count
);
201 * Gets era name strings. For example: "Anno Domini" and "Before Christ".
203 * @param count Filled in with length of the array.
204 * @return the era name strings.
207 const UnicodeString
* getEraNames(int32_t& count
) const;
210 * Sets era name strings. For example: "Anno Domini" and "Before Christ".
211 * @param eraNames Array of era name strings (DateFormatSymbols retains ownership.)
212 * @param count Filled in with length of the array.
215 void setEraNames(const UnicodeString
* eraNames
, int32_t count
);
218 * Gets narrow era strings. For example: "A" and "B".
220 * @param count Filled in with length of the array.
221 * @return the narrow era strings.
224 const UnicodeString
* getNarrowEras(int32_t& count
) const;
227 * Sets narrow era strings. For example: "A" and "B".
228 * @param narrowEras Array of narrow era strings (DateFormatSymbols retains ownership.)
229 * @param count Filled in with length of the array.
232 void setNarrowEras(const UnicodeString
* narrowEras
, int32_t count
);
235 * Gets month strings. For example: "January", "February", etc.
236 * @param count Filled in with length of the array.
237 * @return the month strings. (DateFormatSymbols retains ownership.)
240 const UnicodeString
* getMonths(int32_t& count
) const;
243 * Sets month strings. For example: "January", "February", etc.
245 * @param months the new month strings. (not adopted; caller retains ownership)
246 * @param count Filled in with length of the array.
249 void setMonths(const UnicodeString
* months
, int32_t count
);
252 * Gets short month strings. For example: "Jan", "Feb", etc.
254 * @param count Filled in with length of the array.
255 * @return the short month strings. (DateFormatSymbols retains ownership.)
258 const UnicodeString
* getShortMonths(int32_t& count
) const;
261 * Sets short month strings. For example: "Jan", "Feb", etc.
262 * @param count Filled in with length of the array.
263 * @param shortMonths the new short month strings. (not adopted; caller retains ownership)
266 void setShortMonths(const UnicodeString
* shortMonths
, int32_t count
);
269 * Selector for date formatting context
279 * Selector for date formatting width
286 #ifndef U_HIDE_DRAFT_API
288 * Short width is currently only supported for weekday names.
292 #endif /* U_HIDE_DRAFT_API */
299 * Gets month strings by width and context. For example: "January", "February", etc.
300 * @param count Filled in with length of the array.
301 * @param context The formatting context, either FORMAT or STANDALONE
302 * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
303 * @return the month strings. (DateFormatSymbols retains ownership.)
306 const UnicodeString
* getMonths(int32_t& count
, DtContextType context
, DtWidthType width
) const;
309 * Sets month strings by width and context. For example: "January", "February", etc.
311 * @param months The new month strings. (not adopted; caller retains ownership)
312 * @param count Filled in with length of the array.
313 * @param context The formatting context, either FORMAT or STANDALONE
314 * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
317 void setMonths(const UnicodeString
* months
, int32_t count
, DtContextType context
, DtWidthType width
);
320 * Gets wide weekday strings. For example: "Sunday", "Monday", etc.
321 * @param count Filled in with length of the array.
322 * @return the weekday strings. (DateFormatSymbols retains ownership.)
325 const UnicodeString
* getWeekdays(int32_t& count
) const;
329 * Sets wide weekday strings. For example: "Sunday", "Monday", etc.
330 * @param weekdays the new weekday strings. (not adopted; caller retains ownership)
331 * @param count Filled in with length of the array.
334 void setWeekdays(const UnicodeString
* weekdays
, int32_t count
);
337 * Gets abbreviated weekday strings. For example: "Sun", "Mon", etc. (Note: The method name is
338 * misleading; it does not get the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)
339 * @param count Filled in with length of the array.
340 * @return the abbreviated weekday strings. (DateFormatSymbols retains ownership.)
343 const UnicodeString
* getShortWeekdays(int32_t& count
) const;
346 * Sets abbreviated weekday strings. For example: "Sun", "Mon", etc. (Note: The method name is
347 * misleading; it does not set the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)
348 * @param abbrevWeekdays the new abbreviated weekday strings. (not adopted; caller retains ownership)
349 * @param count Filled in with length of the array.
352 void setShortWeekdays(const UnicodeString
* abbrevWeekdays
, int32_t count
);
355 * Gets weekday strings by width and context. For example: "Sunday", "Monday", etc.
356 * @param count Filled in with length of the array.
357 * @param context The formatting context, either FORMAT or STANDALONE
358 * @param width The width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW
359 * @return the month strings. (DateFormatSymbols retains ownership.)
362 const UnicodeString
* getWeekdays(int32_t& count
, DtContextType context
, DtWidthType width
) const;
365 * Sets weekday strings by width and context. For example: "Sunday", "Monday", etc.
366 * @param weekdays The new weekday strings. (not adopted; caller retains ownership)
367 * @param count Filled in with length of the array.
368 * @param context The formatting context, either FORMAT or STANDALONE
369 * @param width The width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW
372 void setWeekdays(const UnicodeString
* weekdays
, int32_t count
, DtContextType context
, DtWidthType width
);
375 * Gets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
376 * @param count Filled in with length of the array.
377 * @param context The formatting context, either FORMAT or STANDALONE
378 * @param width The width of returned strings, either WIDE or ABBREVIATED. There
379 * are no NARROW quarters.
380 * @return the quarter strings. (DateFormatSymbols retains ownership.)
383 const UnicodeString
* getQuarters(int32_t& count
, DtContextType context
, DtWidthType width
) const;
386 * Sets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
388 * @param quarters The new quarter strings. (not adopted; caller retains ownership)
389 * @param count Filled in with length of the array.
390 * @param context The formatting context, either FORMAT or STANDALONE
391 * @param width The width of returned strings, either WIDE or ABBREVIATED. There
392 * are no NARROW quarters.
395 void setQuarters(const UnicodeString
* quarters
, int32_t count
, DtContextType context
, DtWidthType width
);
398 * Gets AM/PM strings. For example: "AM" and "PM".
399 * @param count Filled in with length of the array.
400 * @return the weekday strings. (DateFormatSymbols retains ownership.)
403 const UnicodeString
* getAmPmStrings(int32_t& count
) const;
406 * Sets ampm strings. For example: "AM" and "PM".
407 * @param ampms the new ampm strings. (not adopted; caller retains ownership)
408 * @param count Filled in with length of the array.
411 void setAmPmStrings(const UnicodeString
* ampms
, int32_t count
);
413 #ifndef U_HIDE_INTERNAL_API
415 * Somewhat temporary constants for leap month pattern types, adequate for supporting
416 * just leap month patterns as needed for Chinese lunar calendar.
417 * Eventually we will add full support for different month pattern types (needed for
418 * other calendars such as Hindu) at which point this approach will be replaced by a
419 * more complete approach.
422 enum EMonthPatternType
424 kLeapMonthPatternFormatWide
,
425 kLeapMonthPatternFormatAbbrev
,
426 kLeapMonthPatternFormatNarrow
,
427 kLeapMonthPatternStandaloneWide
,
428 kLeapMonthPatternStandaloneAbbrev
,
429 kLeapMonthPatternStandaloneNarrow
,
430 kLeapMonthPatternNumeric
,
435 * Somewhat temporary function for getting complete set of leap month patterns for all
436 * contexts & widths, indexed by EMonthPatternType values. Returns NULL if calendar
437 * does not have leap month patterns. Note, there is currently no setter for this.
438 * Eventually we will add full support for different month pattern types (needed for
439 * other calendars such as Hindu) at which point this approach will be replaced by a
440 * more complete approach.
441 * @param count Filled in with length of the array (may be 0).
442 * @return The leap month patterns (DateFormatSymbols retains ownership).
443 * May be NULL if there are no leap month patterns for this calendar.
446 const UnicodeString
* getLeapMonthPatterns(int32_t& count
) const;
448 #endif /* U_HIDE_INTERNAL_API */
450 #ifndef U_HIDE_DEPRECATED_API
452 * Gets timezone strings. These strings are stored in a 2-dimensional array.
453 * @param rowCount Output param to receive number of rows.
454 * @param columnCount Output param to receive number of columns.
455 * @return The timezone strings as a 2-d array. (DateFormatSymbols retains ownership.)
456 * @deprecated ICU 3.6
458 const UnicodeString
** getZoneStrings(int32_t& rowCount
, int32_t& columnCount
) const;
459 #endif /* U_HIDE_DEPRECATED_API */
462 * Sets timezone strings. These strings are stored in a 2-dimensional array.
463 * <p><b>Note:</b> SimpleDateFormat no longer use the zone strings stored in
464 * a DateFormatSymbols. Therefore, the time zone strings set by this mthod
465 * have no effects in an instance of SimpleDateFormat for formatting time
467 * @param strings The timezone strings as a 2-d array to be copied. (not adopted; caller retains ownership)
468 * @param rowCount The number of rows (count of first index).
469 * @param columnCount The number of columns (count of second index).
472 void setZoneStrings(const UnicodeString
* const* strings
, int32_t rowCount
, int32_t columnCount
);
475 * Get the non-localized date-time pattern characters.
476 * @return the non-localized date-time pattern characters
479 static const UChar
* U_EXPORT2
getPatternUChars(void);
482 * Gets localized date-time pattern characters. For example: 'u', 't', etc.
484 * Note: ICU no longer provides localized date-time pattern characters for a locale
485 * starting ICU 3.8. This method returns the non-localized date-time pattern
486 * characters unless user defined localized data is set by setLocalPatternChars.
487 * @param result Output param which will receive the localized date-time pattern characters.
488 * @return A reference to 'result'.
491 UnicodeString
& getLocalPatternChars(UnicodeString
& result
) const;
494 * Sets localized date-time pattern characters. For example: 'u', 't', etc.
495 * @param newLocalPatternChars the new localized date-time
496 * pattern characters.
499 void setLocalPatternChars(const UnicodeString
& newLocalPatternChars
);
502 * Returns the locale for this object. Two flavors are available:
503 * valid and actual locale.
506 Locale
getLocale(ULocDataLocaleType type
, UErrorCode
& status
) const;
508 #ifndef U_HIDE_INTERNAL_API
510 * Constants for capitalization context usage types.
513 enum ECapitalizationContextUsageType
515 kCapContextUsageOther
,
516 kCapContextUsageMonthFormat
, /* except narrow */
517 kCapContextUsageMonthStandalone
, /* except narrow */
518 kCapContextUsageMonthNarrow
,
519 kCapContextUsageDayFormat
, /* except narrow */
520 kCapContextUsageDayStandalone
, /* except narrow */
521 kCapContextUsageDayNarrow
,
522 kCapContextUsageEraWide
,
523 kCapContextUsageEraAbbrev
,
524 kCapContextUsageEraNarrow
,
525 kCapContextUsageZoneLong
,
526 kCapContextUsageZoneShort
,
527 kCapContextUsageMetazoneLong
,
528 kCapContextUsageMetazoneShort
,
529 kCapContextUsageTypeCount
531 #endif /* U_HIDE_INTERNAL_API */
534 * ICU "poor man's RTTI", returns a UClassID for the actual class.
538 virtual UClassID
getDynamicClassID() const;
541 * ICU "poor man's RTTI", returns a UClassID for this class.
545 static UClassID U_EXPORT2
getStaticClassID();
549 friend class SimpleDateFormat
;
550 friend class DateFormatSymbolsSingleSetter
; // see udat.cpp
553 * Abbreviated era strings. For example: "AD" and "BC".
555 UnicodeString
* fEras
;
559 * Era name strings. For example: "Anno Domini" and "Before Christ".
561 UnicodeString
* fEraNames
;
562 int32_t fEraNamesCount
;
565 * Narrow era strings. For example: "A" and "B".
567 UnicodeString
* fNarrowEras
;
568 int32_t fNarrowErasCount
;
571 * Month strings. For example: "January", "February", etc.
573 UnicodeString
* fMonths
;
574 int32_t fMonthsCount
;
577 * Short month strings. For example: "Jan", "Feb", etc.
579 UnicodeString
* fShortMonths
;
580 int32_t fShortMonthsCount
;
583 * Narrow month strings. For example: "J", "F", etc.
585 UnicodeString
* fNarrowMonths
;
586 int32_t fNarrowMonthsCount
;
589 * Standalone Month strings. For example: "January", "February", etc.
591 UnicodeString
* fStandaloneMonths
;
592 int32_t fStandaloneMonthsCount
;
595 * Standalone Short month strings. For example: "Jan", "Feb", etc.
597 UnicodeString
* fStandaloneShortMonths
;
598 int32_t fStandaloneShortMonthsCount
;
601 * Standalone Narrow month strings. For example: "J", "F", etc.
603 UnicodeString
* fStandaloneNarrowMonths
;
604 int32_t fStandaloneNarrowMonthsCount
;
607 * CLDR-style format wide weekday strings. For example: "Sunday", "Monday", etc.
609 UnicodeString
* fWeekdays
;
610 int32_t fWeekdaysCount
;
613 * CLDR-style format abbreviated (not short) weekday strings. For example: "Sun", "Mon", etc.
615 UnicodeString
* fShortWeekdays
;
616 int32_t fShortWeekdaysCount
;
619 * CLDR-style format short weekday strings. For example: "Su", "Mo", etc.
621 UnicodeString
* fShorterWeekdays
;
622 int32_t fShorterWeekdaysCount
;
625 * CLDR-style format narrow weekday strings. For example: "S", "M", etc.
627 UnicodeString
* fNarrowWeekdays
;
628 int32_t fNarrowWeekdaysCount
;
631 * CLDR-style standalone wide weekday strings. For example: "Sunday", "Monday", etc.
633 UnicodeString
* fStandaloneWeekdays
;
634 int32_t fStandaloneWeekdaysCount
;
637 * CLDR-style standalone abbreviated (not short) weekday strings. For example: "Sun", "Mon", etc.
639 UnicodeString
* fStandaloneShortWeekdays
;
640 int32_t fStandaloneShortWeekdaysCount
;
643 * CLDR-style standalone short weekday strings. For example: "Su", "Mo", etc.
645 UnicodeString
* fStandaloneShorterWeekdays
;
646 int32_t fStandaloneShorterWeekdaysCount
;
649 * Standalone Narrow weekday strings. For example: "Sun", "Mon", etc.
651 UnicodeString
* fStandaloneNarrowWeekdays
;
652 int32_t fStandaloneNarrowWeekdaysCount
;
655 * Ampm strings. For example: "AM" and "PM".
657 UnicodeString
* fAmPms
;
661 * Quarter strings. For example: "1st quarter", "2nd quarter", etc.
663 UnicodeString
*fQuarters
;
664 int32_t fQuartersCount
;
667 * Short quarters. For example: "Q1", "Q2", etc.
669 UnicodeString
*fShortQuarters
;
670 int32_t fShortQuartersCount
;
673 * Standalone quarter strings. For example: "1st quarter", "2nd quarter", etc.
675 UnicodeString
*fStandaloneQuarters
;
676 int32_t fStandaloneQuartersCount
;
679 * Standalone short quarter strings. For example: "Q1", "Q2", etc.
681 UnicodeString
*fStandaloneShortQuarters
;
682 int32_t fStandaloneShortQuartersCount
;
685 * All leap month patterns, for example "{0}bis".
687 UnicodeString
*fLeapMonthPatterns
;
688 int32_t fLeapMonthPatternsCount
;
691 * (Format) Short cyclic year names, for example: "jia-zi", "yi-chou", ... "gui-hai"
693 UnicodeString
* fShortYearNames
;
694 int32_t fShortYearNamesCount
;
697 * Localized names of time zones in this locale. This is a
698 * two-dimensional array of strings of size n by m,
699 * where m is at least 5 and up to 7. Each of the n rows is an
700 * entry containing the localized names for a single TimeZone.
702 * Each such row contains (with i ranging from 0..n-1):
704 * zoneStrings[i][0] - time zone ID
705 * example: America/Los_Angeles
706 * zoneStrings[i][1] - long name of zone in standard time
707 * example: Pacific Standard Time
708 * zoneStrings[i][2] - short name of zone in standard time
710 * zoneStrings[i][3] - long name of zone in daylight savings time
711 * example: Pacific Daylight Time
712 * zoneStrings[i][4] - short name of zone in daylight savings time
714 * zoneStrings[i][5] - location name of zone
715 * example: United States (Los Angeles)
716 * zoneStrings[i][6] - long generic name of zone
717 * example: Pacific Time
718 * zoneStrings[i][7] - short generic of zone
721 * The zone ID is not localized; it corresponds to the ID
722 * value associated with a system time zone object. All other entries
723 * are localized names. If a zone does not implement daylight savings
724 * time, the daylight savings time names are ignored.
726 * Note:CLDR 1.5 introduced metazone and its historical mappings.
727 * This simple two-dimensional array is no longer sufficient to represent
728 * localized names and its historic changes. Since ICU 3.8.1, localized
729 * zone names extracted from ICU locale data is stored in a ZoneStringFormat
730 * instance. But we still need to support the old way of customizing
731 * localized zone names, so we keep this field for the purpose.
733 UnicodeString
**fZoneStrings
; // Zone string array set by setZoneStrings
734 UnicodeString
**fLocaleZoneStrings
; // Zone string array created by the locale
735 int32_t fZoneStringsRowCount
;
736 int32_t fZoneStringsColCount
;
738 Locale fZSFLocale
; // Locale used for getting ZoneStringFormat
741 * Localized date-time pattern characters. For example: use 'u' as 'y'.
743 UnicodeString fLocalPatternChars
;
746 * Capitalization transforms. For each usage type, the first array element indicates
747 * whether to titlecase for uiListOrMenu context, the second indicates whether to
748 * titlecase for stand-alone context.
750 UBool fCapitalization
[kCapContextUsageTypeCount
][2];
753 /** valid/actual locale information
754 * these are always ICU locales, so the length should not be a problem
756 char validLocale
[ULOC_FULLNAME_CAPACITY
];
757 char actualLocale
[ULOC_FULLNAME_CAPACITY
];
759 DateFormatSymbols(); // default constructor not implemented
762 * Called by the constructors to actually load data from the resources
764 * @param locale The locale to get symbols for.
765 * @param type Calendar Type (as from Calendar::getType())
766 * @param status Input/output parameter, set to success or
767 * failure code upon return.
768 * @param useLastResortData determine if use last resort data
770 void initializeData(const Locale
& locale
, const char *type
, UErrorCode
& status
, UBool useLastResortData
= FALSE
);
773 * Copy or alias an array in another object, as appropriate.
775 * @param dstArray the copy destination array.
776 * @param dstCount fill in with the lenth of 'dstArray'.
777 * @param srcArray the source array to be copied.
778 * @param srcCount the length of items to be copied from the 'srcArray'.
780 static void assignArray(UnicodeString
*& dstArray
,
782 const UnicodeString
* srcArray
,
786 * Return true if the given arrays' contents are equal, or if the arrays are
787 * identical (pointers are equal).
789 * @param array1 one array to be compared with.
790 * @param array2 another array to be compared with.
791 * @param count the length of items to be copied.
792 * @return true if the given arrays' contents are equal, or if the arrays are
793 * identical (pointers are equal).
795 static UBool
arrayCompare(const UnicodeString
* array1
,
796 const UnicodeString
* array2
,
800 * Create a copy, in fZoneStrings, of the given zone strings array. The
801 * member variables fZoneStringsRowCount and fZoneStringsColCount should be
802 * set already by the caller.
804 void createZoneStrings(const UnicodeString
*const * otherStrings
);
807 * Delete all the storage owned by this object.
812 * Copy all of the other's data to this.
813 * @param other the object to be copied.
815 void copyData(const DateFormatSymbols
& other
);
818 * Create zone strings array by locale if not yet available
820 void initZoneStringsArray(void);
823 * Delete just the zone strings.
825 void disposeZoneStrings(void);
828 * Returns the date format field index of the pattern character c,
829 * or UDAT_FIELD_COUNT if c is not a pattern character.
831 static UDateFormatField U_EXPORT2
getPatternCharIndex(UChar c
);
834 * Returns TRUE if f (with its pattern character repeated count times) is a numeric field.
836 static UBool U_EXPORT2
isNumericField(UDateFormatField f
, int32_t count
);
839 * Returns TRUE if c (repeated count times) is the pattern character for a numeric field.
841 static UBool U_EXPORT2
isNumericPatternChar(UChar c
, int32_t count
);
846 #endif /* #if !UCONFIG_NO_FORMATTING */