#include <dtfmtsym.h>
Inheritance diagram for DateFormatSymbols:
Public Types | |
enum | DtContextType { FORMAT = 0, STANDALONE = 1 } |
enum | DtWidthType { WIDE = 4, ABBREVIATED = 3, NARROW = 5 } |
Public Member Functions | |
DateFormatSymbols (UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian). | |
DateFormatSymbols (const Locale &locale, UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian). | |
DateFormatSymbols (const char *type, UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian). | |
DateFormatSymbols (const Locale &locale, const char *type, UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian). | |
DateFormatSymbols (const DateFormatSymbols &) | |
Copy constructor. | |
DateFormatSymbols & | operator= (const DateFormatSymbols &) |
Assignment operator. | |
virtual | ~DateFormatSymbols () |
Destructor. | |
UBool | operator== (const DateFormatSymbols &other) const |
Return true if another object is semantically equal to this one. | |
UBool | operator!= (const DateFormatSymbols &other) const |
Return true if another object is semantically unequal to this one. | |
const UnicodeString * | getEras (int32_t &count) const |
Gets era strings. | |
void | setEras (const UnicodeString *eras, int32_t count) |
Sets era strings. | |
const UnicodeString * | getEraNames (int32_t &count) const |
Gets era name strings. | |
const UnicodeString * | getMonths (int32_t &count) const |
Gets month strings. | |
void | setMonths (const UnicodeString *months, int32_t count) |
Sets month strings. | |
const UnicodeString * | getShortMonths (int32_t &count) const |
Gets short month strings. | |
void | setShortMonths (const UnicodeString *shortMonths, int32_t count) |
Sets short month strings. | |
const UnicodeString * | getMonths (int32_t &count, DtContextType context, DtWidthType width) const |
Gets month strings by width and context. | |
const UnicodeString * | getWeekdays (int32_t &count) const |
Gets weekday strings. | |
void | setWeekdays (const UnicodeString *weekdays, int32_t count) |
Sets weekday strings. | |
const UnicodeString * | getShortWeekdays (int32_t &count) const |
Gets short weekday strings. | |
void | setShortWeekdays (const UnicodeString *shortWeekdays, int32_t count) |
Sets short weekday strings. | |
const UnicodeString * | getWeekdays (int32_t &count, DtContextType context, DtWidthType width) const |
Gets weekday strings by width and context. | |
const UnicodeString * | getAmPmStrings (int32_t &count) const |
Gets AM/PM strings. | |
void | setAmPmStrings (const UnicodeString *ampms, int32_t count) |
Sets ampm strings. | |
const UnicodeString ** | getZoneStrings (int32_t &rowCount, int32_t &columnCount) const |
Gets timezone strings. | |
void | setZoneStrings (const UnicodeString *const *strings, int32_t rowCount, int32_t columnCount) |
Sets timezone strings. | |
UnicodeString & | getLocalPatternChars (UnicodeString &result) const |
Gets localized date-time pattern characters. | |
void | setLocalPatternChars (const UnicodeString &newLocalPatternChars) |
Sets localized date-time pattern characters. | |
Locale | getLocale (ULocDataLocaleType type, UErrorCode &status) const |
Returns the locale for this object. | |
virtual UClassID | getDynamicClassID () const |
ICU "poor man's RTTI", returns a UClassID for the actual class. | |
Static Public Member Functions | |
static const UChar *U_EXPORT2 | getPatternUChars (void) |
Get the non-localized date-time pattern characters. | |
static UClassID U_EXPORT2 | getStaticClassID () |
ICU "poor man's RTTI", returns a UClassID for this class. | |
Friends | |
class | SimpleDateFormat |
class | DateFormatSymbolsSingleSetter |
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.
DateFormatSymbols are not expected to be subclassed. Data for a calendar is loaded out of resource bundles. The 'type' parameter indicates the type of calendar, for example, "gregorian" or "japanese". If the type is not gregorian (or NULL, or an empty string) then the type is appended to the resource name, for example, 'Eras_japanese' instead of 'Eras'. If the resource 'Eras_japanese' did not exist (even in root), then this class will fall back to just 'Eras', that is, Gregorian data. Therefore, the calendar implementor MUST ensure that the root locale at least contains any resources that are to be particularized for the calendar type.
Definition at line 76 of file dtfmtsym.h.
|
Definition at line 238 of file dtfmtsym.h. |
|
Definition at line 251 of file dtfmtsym.h. |
|
Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian). 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, in the default calendar (Gregorian).
|
|
Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian). 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, in the default calendar (Gregorian).
|
|
Copy constructor.
|
|
Destructor. This is nonvirtual because this class is not designed to be subclassed.
|
|
Gets AM/PM strings. For example: "AM" and "PM".
|
|
ICU "poor man's RTTI", returns a UClassID for the actual class.
Implements UObject. |
|
Gets era name strings. For example: "Anno Domini" and "Before Christ".
|
|
Gets era strings. For example: "AD" and "BC".
|
|
Returns the locale for this object. Two flavors are available: valid and actual locale.
|
|
Gets localized date-time pattern characters. For example: 'u', 't', etc.
|
|
Gets month strings by width and context. For example: "January", "February", etc.
|
|
Gets month strings. For example: "January", "February", etc.
|
|
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.
|
|
Gets weekday strings by width and context. For example: "Sunday", "Monday", etc.
|
|
Gets weekday strings. For example: "Sunday", "Monday", etc.
|
|
Gets timezone strings. These strings are stored in a 2-dimensional array.
|
|
Return true if another object is semantically unequal to this one.
Definition at line 176 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.
|