#include <dtfmtsym.h>
Inheritance diagram for DateFormatSymbols::
Public Methods | |
DateFormatSymbols (UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the default locale. More... | |
DateFormatSymbols (const Locale &locale, UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the given locale. More... | |
DateFormatSymbols (const DateFormatSymbols &) | |
Copy constructor. More... | |
DateFormatSymbols & | operator= (const DateFormatSymbols &) |
Assignment operator. More... | |
~DateFormatSymbols () | |
Destructor. More... | |
UBool | operator== (const DateFormatSymbols &other) const |
Return true if another object is semantically equal to this one. More... | |
UBool | operator!= (const DateFormatSymbols &other) const |
Return true if another object is semantically unequal to this one. More... | |
const UnicodeString * | getEras (int32_t &count) const |
Gets era strings. More... | |
void | setEras (const UnicodeString *eras, int32_t count) |
Sets era strings. More... | |
const UnicodeString * | getMonths (int32_t &count) const |
Gets month strings. More... | |
void | setMonths (const UnicodeString *months, int32_t count) |
Sets month strings. More... | |
const UnicodeString * | getShortMonths (int32_t &count) const |
Gets short month strings. More... | |
void | setShortMonths (const UnicodeString *shortMonths, int32_t count) |
Sets short month strings. More... | |
const UnicodeString * | getWeekdays (int32_t &count) const |
Gets weekday strings. More... | |
void | setWeekdays (const UnicodeString *weekdays, int32_t count) |
Sets weekday strings. More... | |
const UnicodeString * | getShortWeekdays (int32_t &count) const |
Gets short weekday strings. More... | |
void | setShortWeekdays (const UnicodeString *shortWeekdays, int32_t count) |
Sets short weekday strings. More... | |
const UnicodeString * | getAmPmStrings (int32_t &count) const |
Gets AM/PM strings. More... | |
void | setAmPmStrings (const UnicodeString *ampms, int32_t count) |
Sets ampm strings. More... | |
const UnicodeString ** | getZoneStrings (int32_t &rowCount, int32_t &columnCount) const |
Gets timezone strings. More... | |
void | setZoneStrings (const UnicodeString *const *strings, int32_t rowCount, int32_t columnCount) |
Sets timezone strings. More... | |
UnicodeString & | getLocalPatternChars (UnicodeString &result) const |
Gets localized date-time pattern characters. More... | |
void | setLocalPatternChars (const UnicodeString &newLocalPatternChars) |
Sets localized date-time pattern characters. More... | |
virtual UClassID | getDynamicClassID () const |
ICU "poor man's RTTI", returns a UClassID for the actual class. More... | |
Static Public Methods | |
const UnicodeString & | getPatternChars (void) |
Get the non-localized date-time pattern characters. More... | |
const UChar * | getPatternUChars (void) |
Get the non-localized date-time pattern characters. More... | |
UClassID | getStaticClassID () |
ICU "poor man's RTTI", returns a UClassID for this class. More... | |
Private Types | |
typedef enum DateFormatSymbols::LastResortSize | LastResortSize |
enum | LastResortSize { kMonthNum = 13, kMonthLen = 3, kDayNum = 8, kDayLen = 2, kAmPmNum = 2, kAmPmLen = 3, kEraNum = 2, kEraLen = 3, kZoneNum = 5, kZoneLen = 4 } |
Private Methods | |
void | initField (UnicodeString **field, int32_t &length, const ResourceBundle data, UErrorCode &status) |
void | initField (UnicodeString **field, int32_t &length, const UChar *data, LastResortSize numStr, LastResortSize strLen, UErrorCode &status) |
void | initializeData (const Locale &, UErrorCode &status, UBool useLastResortData=FALSE) |
Called by the constructors to actually load data from the resources. More... | |
void | createZoneStrings (const UnicodeString *const *otherStrings) |
Create a copy, in fZoneStrings, of the given zone strings array. More... | |
int32_t | getZoneIndex (const UnicodeString &ID) const |
Package private: used by SimpleDateFormat Gets the index for the given time zone ID to obtain the timezone strings for formatting. More... | |
int32_t | _getZoneIndex (const UnicodeString &id) const |
void | dispose (void) |
Delete all the storage owned by this object and reset the fIsOwned flag to indicate that arrays have been deleted. More... | |
void | copyData (const DateFormatSymbols &other) |
Copy all of the other's data to this. More... | |
void | disposeZoneStrings (void) |
Delete just the zone strings, if they are owned by this object. More... | |
Static Private Methods | |
void | assignArray (UnicodeString *&dstArray, int32_t &dstCount, const UnicodeString *srcArray, int32_t srcCount) |
Copy or alias an array in another object, as appropriate. More... | |
UBool | arrayCompare (const UnicodeString *array1, const UnicodeString *array2, int32_t count) |
Return true if the given arrays' contents are equal, or if the arrays are identical (pointers are equal). More... | |
Private Attributes | |
UnicodeString * | fEras |
Era strings. More... | |
int32_t | fErasCount |
UnicodeString * | fMonths |
Month strings. More... | |
int32_t | fMonthsCount |
UnicodeString * | fShortMonths |
Short month strings. More... | |
int32_t | fShortMonthsCount |
UnicodeString * | fWeekdays |
Weekday strings. More... | |
int32_t | fWeekdaysCount |
UnicodeString * | fShortWeekdays |
Short weekday strings. More... | |
int32_t | fShortWeekdaysCount |
UnicodeString * | fAmPms |
Ampm strings. More... | |
int32_t | fAmPmsCount |
UnicodeString ** | fZoneStrings |
The format data of all the timezones in this locale. More... | |
int32_t | fZoneStringsRowCount |
int32_t | fZoneStringsColCount |
UnicodeString | fLocalPatternChars |
Localized date-time pattern characters. More... | |
Static Private Attributes | |
const char | fgErasTag [] |
Resource bundle file suffix and tag names used by this class. More... | |
const char | fgMonthNamesTag [] |
const char | fgMonthAbbreviationsTag [] |
const char | fgDayNamesTag [] |
const char | fgDayAbbreviationsTag [] |
const char | fgAmPmMarkersTag [] |
const char | fgZoneStringsTag [] |
const char | fgLocalPatternCharsTag [] |
const char | fgClassID |
The address of this static class variable serves as this class's ID for ICU "poor man's RTTI". More... | |
Friends | |
class | SimpleDateFormat |
DateFormatSymbols is used by DateFormat and SimpleDateFormat.
Rather than first creating a DateFormatSymbols to get a date-time formatter by using a SimpleDateFormat constructor, clients are encouraged to create a date-time formatter using the getTimeInstance(), getDateInstance(), or getDateTimeInstance() method in DateFormat. Each of these methods can return a date/time formatter initialized with a default format pattern along with the date-time formatting data for a given or default locale. After a formatter is created, clients may modify the format pattern using the setPattern function as so desired. For more information on using these formatter factory functions, see DateFormat.
If clients decide to create a date-time formatter with a particular format pattern and locale, they can do so with new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)). This will load the appropriate date-time formatting data from the locale.
DateFormatSymbols objects are clonable. When clients obtain a DateFormatSymbols object, they can feel free to modify the date-time formatting data as necessary. For instance, clients can replace the localized date-time format pattern characters with the ones that they feel easy to remember. Or they can change the representative cities originally picked by default to using their favorite ones.
New DateFormatSymbols sub-classes may be added to support SimpleDateFormat for date-time formatting for additional locales.
Definition at line 61 of file dtfmtsym.h.
|
|
|
Definition at line 361 of file dtfmtsym.h. |
|
Construct a DateFormatSymbols object by loading format data from resources for the default locale.
NOTE: This constructor will never fail; if it cannot get resource data for the default locale, it will return a last-resort object based on hard-coded strings.
|
|
Construct a DateFormatSymbols object by loading format data from resources for the given locale.
|
|
Copy constructor.
|
|
Destructor. This is nonvirtual because this class is not designed to be subclassed.
|
|
|
|
Return true if the given arrays' contents are equal, or if the arrays are identical (pointers are equal).
|
|
Copy or alias an array in another object, as appropriate.
|
|
Copy all of the other's data to this.
|
|
Create a copy, in fZoneStrings, of the given zone strings array. The member variables fZoneStringsRowCount and fZoneStringsColCount should be set already by the caller. The fIsOwned flags are not checked or set by this method; that is the caller's responsibility. |
|
Delete all the storage owned by this object and reset the fIsOwned flag to indicate that arrays have been deleted.
|
|
Delete just the zone strings, if they are owned by this object. This method does NOT modify fIsOwned; the caller must handle that. |
|
Gets AM/PM strings. For example: "AM" and "PM".
|
|
ICU "poor man's RTTI", returns a UClassID for the actual class.
Reimplemented from UObject. Definition at line 279 of file dtfmtsym.h. |
|
Gets era strings. For example: "AD" and "BC".
|
|
Gets localized date-time pattern characters. For example: 'u', 't', etc.
|
|
Gets month strings. For example: "January", "February", etc.
|
|
Get the non-localized date-time pattern characters.
|
|
Get the non-localized date-time pattern characters.
|
|
Gets short month strings. For example: "Jan", "Feb", etc.
|
|
Gets short weekday strings. For example: "Sun", "Mon", etc.
|
|
ICU "poor man's RTTI", returns a UClassID for this class.
Definition at line 286 of file dtfmtsym.h. |
|
Gets weekday strings. For example: "Sunday", "Monday", etc.
|
|
Package private: used by SimpleDateFormat Gets the index for the given time zone ID to obtain the timezone strings for formatting. The time zone ID is just for programmatic lookup. NOT LOCALIZED!!!
|
|
Gets timezone strings. These strings are stored in a 2-dimensional array.
|
|
|
|
|
|
Called by the constructors to actually load data from the resources.
|
|
Return true if another object is semantically unequal to this one.
Definition at line 126 of file dtfmtsym.h. |
|
Assignment operator.
|
|
Return true if another object is semantically equal to this one.
|
|
Sets ampm strings. For example: "AM" and "PM".
|
|
Sets era strings. For example: "AD" and "BC".
|
|
Sets localized date-time pattern characters. For example: 'u', 't', etc.
|
|
Sets month strings. For example: "January", "February", etc.
|
|
Sets short month strings. For example: "Jan", "Feb", etc.
|
|
Sets short weekday strings. For example: "Sun", "Mon", etc.
|
|
Sets weekday strings. For example: "Sunday", "Monday", etc.
|
|
Sets timezone strings. These strings are stored in a 2-dimensional array.
|
|
Definition at line 302 of file dtfmtsym.h. |
|
Ampm strings. For example: "AM" and "PM". Definition at line 337 of file dtfmtsym.h. |
|
Definition at line 338 of file dtfmtsym.h. |
|
Era strings. For example: "AD" and "BC". Definition at line 307 of file dtfmtsym.h. |
|
Definition at line 308 of file dtfmtsym.h. |
|
Localized date-time pattern characters. For example: use 'u' as 'y'. Definition at line 350 of file dtfmtsym.h. |
|
Month strings. For example: "January", "February", etc. Definition at line 313 of file dtfmtsym.h. |
|
Definition at line 314 of file dtfmtsym.h. |
|
Short month strings. For example: "Jan", "Feb", etc. Definition at line 319 of file dtfmtsym.h. |
|
Definition at line 320 of file dtfmtsym.h. |
|
Short weekday strings. For example: "Sun", "Mon", etc. Definition at line 331 of file dtfmtsym.h. |
|
Definition at line 332 of file dtfmtsym.h. |
|
Weekday strings. For example: "Sunday", "Monday", etc. Definition at line 325 of file dtfmtsym.h. |
|
Definition at line 326 of file dtfmtsym.h. |
|
The format data of all the timezones in this locale.
Definition at line 343 of file dtfmtsym.h. |
|
Definition at line 345 of file dtfmtsym.h. |
|
Definition at line 344 of file dtfmtsym.h. |
|
Definition at line 297 of file dtfmtsym.h. |
|
The address of this static class variable serves as this class's ID for ICU "poor man's RTTI".
Definition at line 356 of file dtfmtsym.h. |
|
Definition at line 296 of file dtfmtsym.h. |
|
Definition at line 295 of file dtfmtsym.h. |
|
Resource bundle file suffix and tag names used by this class.
Definition at line 292 of file dtfmtsym.h. |
|
Definition at line 300 of file dtfmtsym.h. |
|
Definition at line 294 of file dtfmtsym.h. |
|
Definition at line 293 of file dtfmtsym.h. |
|
Definition at line 299 of file dtfmtsym.h. |