Home | History | Annotate | Download | only in unicode
      1 /*
      2 ********************************************************************************
      3 *   Copyright (C) 1997-2011, International Business Machines
      4 *   Corporation and others.  All Rights Reserved.
      5 ********************************************************************************
      6 *
      7 * File DTFMTSYM.H
      8 *
      9 * Modification History:
     10 *
     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 ********************************************************************************
     16 */
     17 
     18 #ifndef DTFMTSYM_H
     19 #define DTFMTSYM_H
     20 
     21 #include "unicode/utypes.h"
     22 
     23 #if !UCONFIG_NO_FORMATTING
     24 
     25 #include "unicode/calendar.h"
     26 #include "unicode/uobject.h"
     27 #include "unicode/locid.h"
     28 #include "unicode/ures.h"
     29 
     30 /**
     31  * \file
     32  * \brief C++ API: Symbols for formatting dates.
     33  */
     34 
     35 U_NAMESPACE_BEGIN
     36 
     37 /* forward declaration */
     38 class SimpleDateFormat;
     39 class Hashtable;
     40 
     41 /**
     42  * DateFormatSymbols is a public class for encapsulating localizable date-time
     43  * formatting data -- including timezone data. DateFormatSymbols is used by
     44  * DateFormat and SimpleDateFormat.
     45  * <P>
     46  * Rather than first creating a DateFormatSymbols to get a date-time formatter
     47  * by using a SimpleDateFormat constructor, clients are encouraged to create a
     48  * date-time formatter using the getTimeInstance(), getDateInstance(), or
     49  * getDateTimeInstance() method in DateFormat. Each of these methods can return a
     50  * date/time formatter initialized with a default format pattern along with the
     51  * date-time formatting data for a given or default locale. After a formatter is
     52  * created, clients may modify the format pattern using the setPattern function
     53  * as so desired. For more information on using these formatter factory
     54  * functions, see DateFormat.
     55  * <P>
     56  * If clients decide to create a date-time formatter with a particular format
     57  * pattern and locale, they can do so with new SimpleDateFormat(aPattern,
     58  * new DateFormatSymbols(aLocale)).  This will load the appropriate date-time
     59  * formatting data from the locale.
     60  * <P>
     61  * DateFormatSymbols objects are clonable. When clients obtain a
     62  * DateFormatSymbols object, they can feel free to modify the date-time
     63  * formatting data as necessary. For instance, clients can
     64  * replace the localized date-time format pattern characters with the ones that
     65  * they feel easy to remember. Or they can change the representative cities
     66  * originally picked by default to using their favorite ones.
     67  * <P>
     68  * DateFormatSymbols are not expected to be subclassed. Data for a calendar is
     69  * loaded out of resource bundles.  The 'type' parameter indicates the type of
     70  * calendar, for example, "gregorian" or "japanese".  If the type is not gregorian
     71  * (or NULL, or an empty string) then the type is appended to the resource name,
     72  * for example,  'Eras_japanese' instead of 'Eras'.   If the resource 'Eras_japanese' did
     73  * not exist (even in root), then this class will fall back to just 'Eras', that is,
     74  * Gregorian data.  Therefore, the calendar implementor MUST ensure that the root
     75  * locale at least contains any resources that are to be particularized for the
     76  * calendar type.
     77  */
     78 class U_I18N_API DateFormatSymbols : public UObject {
     79 public:
     80     /**
     81      * Construct a DateFormatSymbols object by loading format data from
     82      * resources for the default locale, in the default calendar (Gregorian).
     83      * <P>
     84      * NOTE: This constructor will never fail; if it cannot get resource
     85      * data for the default locale, it will return a last-resort object
     86      * based on hard-coded strings.
     87      *
     88      * @param status    Status code.  Failure
     89      *                  results if the resources for the default cannot be
     90      *                  found or cannot be loaded
     91      * @stable ICU 2.0
     92      */
     93     DateFormatSymbols(UErrorCode& status);
     94 
     95     /**
     96      * Construct a DateFormatSymbols object by loading format data from
     97      * resources for the given locale, in the default calendar (Gregorian).
     98      *
     99      * @param locale    Locale to load format data from.
    100      * @param status    Status code.  Failure
    101      *                  results if the resources for the locale cannot be
    102      *                  found or cannot be loaded
    103      * @stable ICU 2.0
    104      */
    105     DateFormatSymbols(const Locale& locale,
    106                       UErrorCode& status);
    107 
    108     /**
    109      * Construct a DateFormatSymbols object by loading format data from
    110      * resources for the default locale, in the default calendar (Gregorian).
    111      * <P>
    112      * NOTE: This constructor will never fail; if it cannot get resource
    113      * data for the default locale, it will return a last-resort object
    114      * based on hard-coded strings.
    115      *
    116      * @param type      Type of calendar (as returned by Calendar::getType).
    117      *                  Will be used to access the correct set of strings.
    118      *                  (NULL or empty string defaults to "gregorian".)
    119      * @param status    Status code.  Failure
    120      *                  results if the resources for the default cannot be
    121      *                  found or cannot be loaded
    122      * @internal
    123      */
    124     DateFormatSymbols(const char *type, UErrorCode& status);
    125 
    126     /**
    127      * Construct a DateFormatSymbols object by loading format data from
    128      * resources for the given locale, in the default calendar (Gregorian).
    129      *
    130      * @param locale    Locale to load format data from.
    131      * @param type      Type of calendar (as returned by Calendar::getType).
    132      *                  Will be used to access the correct set of strings.
    133      *                  (NULL or empty string defaults to "gregorian".)
    134      * @param status    Status code.  Failure
    135      *                  results if the resources for the locale cannot be
    136      *                  found or cannot be loaded
    137      * @internal
    138      */
    139     DateFormatSymbols(const Locale& locale,
    140                       const char *type,
    141                       UErrorCode& status);
    142 
    143     /**
    144      * Copy constructor.
    145      * @stable ICU 2.0
    146      */
    147     DateFormatSymbols(const DateFormatSymbols&);
    148 
    149     /**
    150      * Assignment operator.
    151      * @stable ICU 2.0
    152      */
    153     DateFormatSymbols& operator=(const DateFormatSymbols&);
    154 
    155     /**
    156      * Destructor. This is nonvirtual because this class is not designed to be
    157      * subclassed.
    158      * @stable ICU 2.0
    159      */
    160     virtual ~DateFormatSymbols();
    161 
    162     /**
    163      * Return true if another object is semantically equal to this one.
    164      *
    165      * @param other    the DateFormatSymbols object to be compared with.
    166      * @return         true if other is semantically equal to this.
    167      * @stable ICU 2.0
    168      */
    169     UBool operator==(const DateFormatSymbols& other) const;
    170 
    171     /**
    172      * Return true if another object is semantically unequal to this one.
    173      *
    174      * @param other    the DateFormatSymbols object to be compared with.
    175      * @return         true if other is semantically unequal to this.
    176      * @stable ICU 2.0
    177      */
    178     UBool operator!=(const DateFormatSymbols& other) const { return !operator==(other); }
    179 
    180     /**
    181      * Gets abbreviated era strings. For example: "AD" and "BC".
    182      *
    183      * @param count    Filled in with length of the array.
    184      * @return         the era strings.
    185      * @stable ICU 2.0
    186      */
    187     const UnicodeString* getEras(int32_t& count) const;
    188 
    189     /**
    190      * Sets abbreviated era strings. For example: "AD" and "BC".
    191      * @param eras  Array of era strings (DateFormatSymbols retains ownership.)
    192      * @param count Filled in with length of the array.
    193      * @stable ICU 2.0
    194      */
    195     void setEras(const UnicodeString* eras, int32_t count);
    196 
    197     /**
    198      * Gets era name strings. For example: "Anno Domini" and "Before Christ".
    199      *
    200      * @param count    Filled in with length of the array.
    201      * @return         the era name strings.
    202      * @stable ICU 3.4
    203      */
    204     const UnicodeString* getEraNames(int32_t& count) const;
    205 
    206     /**
    207      * Sets era name strings. For example: "Anno Domini" and "Before Christ".
    208      * @param eraNames  Array of era name strings (DateFormatSymbols retains ownership.)
    209      * @param count Filled in with length of the array.
    210      * @stable ICU 3.6
    211      */
    212     void setEraNames(const UnicodeString* eraNames, int32_t count);
    213 
    214     /**
    215      * Gets narrow era strings. For example: "A" and "B".
    216      *
    217      * @param count    Filled in with length of the array.
    218      * @return         the narrow era strings.
    219      * @stable ICU 4.2
    220      */
    221     const UnicodeString* getNarrowEras(int32_t& count) const;
    222 
    223     /**
    224      * Sets narrow era strings. For example: "A" and "B".
    225      * @param narrowEras  Array of narrow era strings (DateFormatSymbols retains ownership.)
    226      * @param count Filled in with length of the array.
    227      * @stable ICU 4.2
    228      */
    229     void setNarrowEras(const UnicodeString* narrowEras, int32_t count);
    230 
    231     /**
    232      * Gets month strings. For example: "January", "February", etc.
    233      * @param count Filled in with length of the array.
    234      * @return the month strings. (DateFormatSymbols retains ownership.)
    235      * @stable ICU 2.0
    236      */
    237     const UnicodeString* getMonths(int32_t& count) const;
    238 
    239     /**
    240      * Sets month strings. For example: "January", "February", etc.
    241      *
    242      * @param months    the new month strings. (not adopted; caller retains ownership)
    243      * @param count     Filled in with length of the array.
    244      * @stable ICU 2.0
    245      */
    246     void setMonths(const UnicodeString* months, int32_t count);
    247 
    248     /**
    249      * Gets short month strings. For example: "Jan", "Feb", etc.
    250      *
    251      * @param count Filled in with length of the array.
    252      * @return the short month strings. (DateFormatSymbols retains ownership.)
    253      * @stable ICU 2.0
    254      */
    255     const UnicodeString* getShortMonths(int32_t& count) const;
    256 
    257     /**
    258      * Sets short month strings. For example: "Jan", "Feb", etc.
    259      * @param count        Filled in with length of the array.
    260      * @param shortMonths  the new short month strings. (not adopted; caller retains ownership)
    261      * @stable ICU 2.0
    262      */
    263     void setShortMonths(const UnicodeString* shortMonths, int32_t count);
    264 
    265     /**
    266      * Selector for date formatting context
    267      * @stable ICU 3.6
    268      */
    269     enum DtContextType {
    270          FORMAT,
    271          STANDALONE,
    272          DT_CONTEXT_COUNT
    273     };
    274 
    275     /**
    276      * Selector for date formatting width
    277      * @stable ICU 3.6
    278      */
    279     enum DtWidthType {
    280          ABBREVIATED,
    281          WIDE,
    282          NARROW,
    283          DT_WIDTH_COUNT
    284     };
    285 
    286     /**
    287      * Gets month strings by width and context. For example: "January", "February", etc.
    288      * @param count Filled in with length of the array.
    289      * @param context The formatting context, either FORMAT or STANDALONE
    290      * @param width   The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
    291      * @return the month strings. (DateFormatSymbols retains ownership.)
    292      * @stable ICU 3.4
    293      */
    294     const UnicodeString* getMonths(int32_t& count, DtContextType context, DtWidthType width) const;
    295 
    296     /**
    297      * Sets month strings by width and context. For example: "January", "February", etc.
    298      *
    299      * @param months  The new month strings. (not adopted; caller retains ownership)
    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      * @stable ICU 3.6
    304      */
    305     void setMonths(const UnicodeString* months, int32_t count, DtContextType context, DtWidthType width);
    306 
    307     /**
    308      * Gets weekday strings. For example: "Sunday", "Monday", etc.
    309      * @param count        Filled in with length of the array.
    310      * @return the weekday strings. (DateFormatSymbols retains ownership.)
    311      * @stable ICU 2.0
    312      */
    313     const UnicodeString* getWeekdays(int32_t& count) const;
    314 
    315 
    316     /**
    317      * Sets weekday strings. For example: "Sunday", "Monday", etc.
    318      * @param weekdays     the new weekday strings. (not adopted; caller retains ownership)
    319      * @param count        Filled in with length of the array.
    320      * @stable ICU 2.0
    321      */
    322     void setWeekdays(const UnicodeString* weekdays, int32_t count);
    323 
    324     /**
    325      * Gets short weekday strings. For example: "Sun", "Mon", etc.
    326      * @param count        Filled in with length of the array.
    327      * @return             the short weekday strings. (DateFormatSymbols retains ownership.)
    328      * @stable ICU 2.0
    329      */
    330     const UnicodeString* getShortWeekdays(int32_t& count) const;
    331 
    332     /**
    333      * Sets short weekday strings. For example: "Sun", "Mon", etc.
    334      * @param shortWeekdays  the new short weekday strings. (not adopted; caller retains ownership)
    335      * @param count          Filled in with length of the array.
    336      * @stable ICU 2.0
    337      */
    338     void setShortWeekdays(const UnicodeString* shortWeekdays, int32_t count);
    339 
    340     /**
    341      * Gets weekday strings by width and context. For example: "Sunday", "Monday", etc.
    342      * @param count   Filled in with length of the array.
    343      * @param context The formatting context, either FORMAT or STANDALONE
    344      * @param width   The width of returned strings, either WIDE, ABBREVIATED, or NARROW
    345      * @return the month strings. (DateFormatSymbols retains ownership.)
    346      * @stable ICU 3.4
    347      */
    348     const UnicodeString* getWeekdays(int32_t& count, DtContextType context, DtWidthType width) const;
    349 
    350     /**
    351      * Sets weekday strings by width and context. For example: "Sunday", "Monday", etc.
    352      * @param weekdays  The new weekday strings. (not adopted; caller retains ownership)
    353      * @param count     Filled in with length of the array.
    354      * @param context   The formatting context, either FORMAT or STANDALONE
    355      * @param width     The width of returned strings, either WIDE, ABBREVIATED, or NARROW
    356      * @stable ICU 3.6
    357      */
    358     void setWeekdays(const UnicodeString* weekdays, int32_t count, DtContextType context, DtWidthType width);
    359 
    360     /**
    361      * Gets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
    362      * @param count Filled in with length of the array.
    363      * @param context The formatting context, either FORMAT or STANDALONE
    364      * @param width   The width of returned strings, either WIDE or ABBREVIATED. There
    365      *                are no NARROW quarters.
    366      * @return the quarter strings. (DateFormatSymbols retains ownership.)
    367      * @stable ICU 3.6
    368      */
    369     const UnicodeString* getQuarters(int32_t& count, DtContextType context, DtWidthType width) const;
    370 
    371     /**
    372      * Sets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
    373      *
    374      * @param quarters  The new quarter strings. (not adopted; caller retains ownership)
    375      * @param count   Filled in with length of the array.
    376      * @param context The formatting context, either FORMAT or STANDALONE
    377      * @param width   The width of returned strings, either WIDE or ABBREVIATED. There
    378      *                are no NARROW quarters.
    379      * @stable ICU 3.6
    380      */
    381     void setQuarters(const UnicodeString* quarters, int32_t count, DtContextType context, DtWidthType width);
    382 
    383     /**
    384      * Gets AM/PM strings. For example: "AM" and "PM".
    385      * @param count        Filled in with length of the array.
    386      * @return             the weekday strings. (DateFormatSymbols retains ownership.)
    387      * @stable ICU 2.0
    388      */
    389     const UnicodeString* getAmPmStrings(int32_t& count) const;
    390 
    391     /**
    392      * Sets ampm strings. For example: "AM" and "PM".
    393      * @param ampms        the new ampm strings. (not adopted; caller retains ownership)
    394      * @param count        Filled in with length of the array.
    395      * @stable ICU 2.0
    396      */
    397     void setAmPmStrings(const UnicodeString* ampms, int32_t count);
    398 
    399     /**
    400      * Gets timezone strings. These strings are stored in a 2-dimensional array.
    401      * @param rowCount      Output param to receive number of rows.
    402      * @param columnCount   Output param to receive number of columns.
    403      * @return              The timezone strings as a 2-d array. (DateFormatSymbols retains ownership.)
    404      * @deprecated ICU 3.6
    405      */
    406     const UnicodeString** getZoneStrings(int32_t& rowCount, int32_t& columnCount) const;
    407 
    408     /**
    409      * Sets timezone strings. These strings are stored in a 2-dimensional array.
    410      * <p><b>Note:</b> SimpleDateFormat no longer use the zone strings stored in
    411      * a DateFormatSymbols. Therefore, the time zone strings set by this mthod
    412      * have no effects in an instance of SimpleDateFormat for formatting time
    413      * zones.
    414      * @param strings       The timezone strings as a 2-d array to be copied. (not adopted; caller retains ownership)
    415      * @param rowCount      The number of rows (count of first index).
    416      * @param columnCount   The number of columns (count of second index).
    417      * @stable ICU 2.0
    418      */
    419     void setZoneStrings(const UnicodeString* const* strings, int32_t rowCount, int32_t columnCount);
    420 
    421     /**
    422      * Get the non-localized date-time pattern characters.
    423      * @return    the non-localized date-time pattern characters
    424      * @stable ICU 2.0
    425      */
    426     static const UChar * U_EXPORT2 getPatternUChars(void);
    427 
    428     /**
    429      * Gets localized date-time pattern characters. For example: 'u', 't', etc.
    430      * <p>
    431      * Note: ICU no longer provides localized date-time pattern characters for a locale
    432      * starting ICU 3.8.  This method returns the non-localized date-time pattern
    433      * characters unless user defined localized data is set by setLocalPatternChars.
    434      * @param result    Output param which will receive the localized date-time pattern characters.
    435      * @return          A reference to 'result'.
    436      * @stable ICU 2.0
    437      */
    438     UnicodeString& getLocalPatternChars(UnicodeString& result) const;
    439 
    440     /**
    441      * Sets localized date-time pattern characters. For example: 'u', 't', etc.
    442      * @param newLocalPatternChars the new localized date-time
    443      * pattern characters.
    444      * @stable ICU 2.0
    445      */
    446     void setLocalPatternChars(const UnicodeString& newLocalPatternChars);
    447 
    448     /**
    449      * Returns the locale for this object. Two flavors are available:
    450      * valid and actual locale.
    451      * @stable ICU 2.8
    452      */
    453     Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
    454 
    455     /**
    456      * ICU "poor man's RTTI", returns a UClassID for the actual class.
    457      *
    458      * @stable ICU 2.2
    459      */
    460     virtual UClassID getDynamicClassID() const;
    461 
    462     /**
    463      * ICU "poor man's RTTI", returns a UClassID for this class.
    464      *
    465      * @stable ICU 2.2
    466      */
    467     static UClassID U_EXPORT2 getStaticClassID();
    468 
    469 private:
    470 
    471     friend class SimpleDateFormat;
    472     friend class DateFormatSymbolsSingleSetter; // see udat.cpp
    473 
    474     /**
    475      * Abbreviated era strings. For example: "AD" and "BC".
    476      */
    477     UnicodeString*  fEras;
    478     int32_t         fErasCount;
    479 
    480     /**
    481      * Era name strings. For example: "Anno Domini" and "Before Christ".
    482      */
    483     UnicodeString*  fEraNames;
    484     int32_t         fEraNamesCount;
    485 
    486     /**
    487      * Narrow era strings. For example: "A" and "B".
    488      */
    489     UnicodeString*  fNarrowEras;
    490     int32_t         fNarrowErasCount;
    491 
    492     /**
    493      * Month strings. For example: "January", "February", etc.
    494      */
    495     UnicodeString*  fMonths;
    496     int32_t         fMonthsCount;
    497 
    498     /**
    499      * Short month strings. For example: "Jan", "Feb", etc.
    500      */
    501     UnicodeString*  fShortMonths;
    502     int32_t         fShortMonthsCount;
    503 
    504     /**
    505      * Narrow month strings. For example: "J", "F", etc.
    506      */
    507     UnicodeString*  fNarrowMonths;
    508     int32_t         fNarrowMonthsCount;
    509 
    510     /**
    511      * Standalone Month strings. For example: "January", "February", etc.
    512      */
    513     UnicodeString*  fStandaloneMonths;
    514     int32_t         fStandaloneMonthsCount;
    515 
    516     /**
    517      * Standalone Short month strings. For example: "Jan", "Feb", etc.
    518      */
    519     UnicodeString*  fStandaloneShortMonths;
    520     int32_t         fStandaloneShortMonthsCount;
    521 
    522     /**
    523      * Standalone Narrow month strings. For example: "J", "F", etc.
    524      */
    525     UnicodeString*  fStandaloneNarrowMonths;
    526     int32_t         fStandaloneNarrowMonthsCount;
    527 
    528     /**
    529      * Weekday strings. For example: "Sunday", "Monday", etc.
    530      */
    531     UnicodeString*  fWeekdays;
    532     int32_t         fWeekdaysCount;
    533 
    534     /**
    535      * Short weekday strings. For example: "Sun", "Mon", etc.
    536      */
    537     UnicodeString*  fShortWeekdays;
    538     int32_t         fShortWeekdaysCount;
    539 
    540     /**
    541      * Narrow weekday strings. For example: "Sun", "Mon", etc.
    542      */
    543     UnicodeString*  fNarrowWeekdays;
    544     int32_t         fNarrowWeekdaysCount;
    545 
    546     /**
    547      * Standalone Weekday strings. For example: "Sunday", "Monday", etc.
    548      */
    549     UnicodeString*  fStandaloneWeekdays;
    550     int32_t         fStandaloneWeekdaysCount;
    551 
    552     /**
    553      * Standalone Short weekday strings. For example: "Sun", "Mon", etc.
    554      */
    555     UnicodeString*  fStandaloneShortWeekdays;
    556     int32_t         fStandaloneShortWeekdaysCount;
    557 
    558     /**
    559      * Standalone Narrow weekday strings. For example: "Sun", "Mon", etc.
    560      */
    561     UnicodeString*  fStandaloneNarrowWeekdays;
    562     int32_t         fStandaloneNarrowWeekdaysCount;
    563 
    564     /**
    565      * Ampm strings. For example: "AM" and "PM".
    566      */
    567     UnicodeString*  fAmPms;
    568     int32_t         fAmPmsCount;
    569 
    570     /**
    571      * Quarter strings. For example: "1st quarter", "2nd quarter", etc.
    572      */
    573     UnicodeString  *fQuarters;
    574     int32_t         fQuartersCount;
    575 
    576     /**
    577      * Short quarters. For example: "Q1", "Q2", etc.
    578      */
    579     UnicodeString  *fShortQuarters;
    580     int32_t         fShortQuartersCount;
    581 
    582     /**
    583      * Standalone quarter strings. For example: "1st quarter", "2nd quarter", etc.
    584      */
    585     UnicodeString  *fStandaloneQuarters;
    586     int32_t         fStandaloneQuartersCount;
    587 
    588     /**
    589      * Standalone short quarter strings. For example: "Q1", "Q2", etc.
    590      */
    591     UnicodeString  *fStandaloneShortQuarters;
    592     int32_t         fStandaloneShortQuartersCount;
    593 
    594     /**
    595      * Localized names of time zones in this locale.  This is a
    596      * two-dimensional array of strings of size n by m,
    597      * where m is at least 5 and up to 7.  Each of the n rows is an
    598      * entry containing the localized names for a single TimeZone.
    599      *
    600      * Each such row contains (with i ranging from 0..n-1):
    601      *
    602      * zoneStrings[i][0] - time zone ID
    603      *  example: America/Los_Angeles
    604      * zoneStrings[i][1] - long name of zone in standard time
    605      *  example: Pacific Standard Time
    606      * zoneStrings[i][2] - short name of zone in standard time
    607      *  example: PST
    608      * zoneStrings[i][3] - long name of zone in daylight savings time
    609      *  example: Pacific Daylight Time
    610      * zoneStrings[i][4] - short name of zone in daylight savings time
    611      *  example: PDT
    612      * zoneStrings[i][5] - location name of zone
    613      *  example: United States (Los Angeles)
    614      * zoneStrings[i][6] - long generic name of zone
    615      *  example: Pacific Time
    616      * zoneStrings[i][7] - short generic of zone
    617      *  example: PT
    618      *
    619      * The zone ID is not localized; it corresponds to the ID
    620      * value associated with a system time zone object.  All other entries
    621      * are localized names.  If a zone does not implement daylight savings
    622      * time, the daylight savings time names are ignored.
    623      *
    624      * Note:CLDR 1.5 introduced metazone and its historical mappings.
    625      * This simple two-dimensional array is no longer sufficient to represent
    626      * localized names and its historic changes.  Since ICU 3.8.1, localized
    627      * zone names extracted from ICU locale data is stored in a ZoneStringFormat
    628      * instance.  But we still need to support the old way of customizing
    629      * localized zone names, so we keep this field for the purpose.
    630      */
    631     UnicodeString   **fZoneStrings;         // Zone string array set by setZoneStrings
    632     UnicodeString   **fLocaleZoneStrings;   // Zone string array created by the locale
    633     int32_t         fZoneStringsRowCount;
    634     int32_t         fZoneStringsColCount;
    635 
    636     Locale                  fZSFLocale;         // Locale used for getting ZoneStringFormat
    637 
    638     /**
    639      * String used for localized GMT. For example, "GMT"
    640      */
    641     UnicodeString fGmtZero;
    642 
    643     /**
    644      * Pattern string used for localized time zone GMT format.  For example, "GMT{0}"
    645      */
    646     UnicodeString   fGmtFormat;
    647 
    648     /**
    649      * Pattern strings used for formatting zone offset in a localized time zone GMT string.
    650      */
    651     UnicodeString  *fGmtHourFormats;
    652     int32_t         fGmtHourFormatsCount;
    653 
    654     enum GMTHourType {
    655         GMT_NEGATIVE_HMS = 0,
    656         GMT_NEGATIVE_HM,
    657         GMT_POSITIVE_HMS,
    658         GMT_POSITIVE_HM,
    659         GMT_HOUR_COUNT
    660     };
    661 
    662     /**
    663      * Localized date-time pattern characters. For example: use 'u' as 'y'.
    664      */
    665     UnicodeString   fLocalPatternChars;
    666 
    667 private:
    668     /** valid/actual locale information
    669      *  these are always ICU locales, so the length should not be a problem
    670      */
    671     char validLocale[ULOC_FULLNAME_CAPACITY];
    672     char actualLocale[ULOC_FULLNAME_CAPACITY];
    673 
    674     DateFormatSymbols(); // default constructor not implemented
    675 
    676     /**
    677      * Called by the constructors to actually load data from the resources
    678      *
    679      * @param locale               The locale to get symbols for.
    680      * @param type                 Calendar Type (as from Calendar::getType())
    681      * @param status               Input/output parameter, set to success or
    682      *                             failure code upon return.
    683      * @param useLastResortData    determine if use last resort data
    684      */
    685     void initializeData(const Locale& locale, const char *type, UErrorCode& status, UBool useLastResortData = FALSE);
    686 
    687     /**
    688      * Copy or alias an array in another object, as appropriate.
    689      *
    690      * @param dstArray    the copy destination array.
    691      * @param dstCount    fill in with the lenth of 'dstArray'.
    692      * @param srcArray    the source array to be copied.
    693      * @param srcCount    the length of items to be copied from the 'srcArray'.
    694      */
    695     static void assignArray(UnicodeString*& dstArray,
    696                             int32_t& dstCount,
    697                             const UnicodeString* srcArray,
    698                             int32_t srcCount);
    699 
    700     /**
    701      * Return true if the given arrays' contents are equal, or if the arrays are
    702      * identical (pointers are equal).
    703      *
    704      * @param array1   one array to be compared with.
    705      * @param array2   another array to be compared with.
    706      * @param count    the length of items to be copied.
    707      * @return         true if the given arrays' contents are equal, or if the arrays are
    708      *                 identical (pointers are equal).
    709      */
    710     static UBool arrayCompare(const UnicodeString* array1,
    711                              const UnicodeString* array2,
    712                              int32_t count);
    713 
    714     /**
    715      * Create a copy, in fZoneStrings, of the given zone strings array. The
    716      * member variables fZoneStringsRowCount and fZoneStringsColCount should be
    717      * set already by the caller.
    718      */
    719     void createZoneStrings(const UnicodeString *const * otherStrings);
    720 
    721     /**
    722      * Delete all the storage owned by this object.
    723      */
    724     void dispose(void);
    725 
    726     /**
    727      * Copy all of the other's data to this.
    728      * @param other the object to be copied.
    729      */
    730     void copyData(const DateFormatSymbols& other);
    731 
    732     /**
    733      * Create zone strings array by locale if not yet available
    734      */
    735     void initZoneStringsArray(void);
    736 
    737     /**
    738      * Delete just the zone strings.
    739      */
    740     void disposeZoneStrings(void);
    741 };
    742 
    743 U_NAMESPACE_END
    744 
    745 #endif /* #if !UCONFIG_NO_FORMATTING */
    746 
    747 #endif // _DTFMTSYM
    748 //eof
    749