ICU 78.2 78.2 |
DateFormatSymbols is a public class for encapsulating localizable date-time formatting data – including timezone data.More...
#include <dtfmtsym.h>

Public Types | |
| enum | DtContextType {FORMAT,STANDALONE,DT_CONTEXT_COUNT } |
| Selector for date formatting context.More... | |
| enum | DtWidthType { ABBREVIATED,WIDE,NARROW,SHORT, DT_WIDTH_COUNT = 4 } |
| Selector for date formatting width.More... | |
| enum | EMonthPatternType { kLeapMonthPatternFormatWide,kLeapMonthPatternFormatAbbrev,kLeapMonthPatternFormatNarrow,kLeapMonthPatternStandaloneWide, kLeapMonthPatternStandaloneAbbrev,kLeapMonthPatternStandaloneNarrow,kLeapMonthPatternNumeric,kMonthPatternsCount } |
| Somewhat temporary constants for leap month pattern types, adequate for supporting just leap month patterns as needed for Chinese lunar calendar.More... | |
| enum | ECapitalizationContextUsageType { kCapContextUsageOther = 0,kCapContextUsageMonthFormat,kCapContextUsageMonthStandalone,kCapContextUsageMonthNarrow, kCapContextUsageDayFormat,kCapContextUsageDayStandalone,kCapContextUsageDayNarrow,kCapContextUsageEraWide, kCapContextUsageEraAbbrev,kCapContextUsageEraNarrow,kCapContextUsageZoneLong,kCapContextUsageZoneShort, kCapContextUsageMetazoneLong,kCapContextUsageMetazoneShort,kCapContextUsageTypeCount = 14 } |
| Constants for capitalization context usage types.More... | |
Public Member Functions | |
| U_I18N_API | DateFormatSymbols (UErrorCode &status) |
| Construct aDateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian).More... | |
| U_I18N_API | DateFormatSymbols (constLocale &locale,UErrorCode &status) |
| Construct aDateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).More... | |
| U_I18N_API | DateFormatSymbols (const char *type,UErrorCode &status) |
| Construct aDateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian).More... | |
| U_I18N_API | DateFormatSymbols (constLocale &locale, const char *type,UErrorCode &status) |
| Construct aDateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).More... | |
| U_I18N_API | DateFormatSymbols (constDateFormatSymbols &) |
| Copy constructor.More... | |
| U_I18N_APIDateFormatSymbols & | operator= (constDateFormatSymbols &) |
| Assignment operator.More... | |
| virtualU_I18N_API | ~DateFormatSymbols () |
| Destructor.More... | |
| U_I18N_API bool | operator== (constDateFormatSymbols &other) const |
| Return true if another object is semantically equal to this one.More... | |
| U_I18N_API bool | operator!= (constDateFormatSymbols &other) const |
| Return true if another object is semantically unequal to this one.More... | |
| U_I18N_API constUnicodeString * | getEras (int32_t &count) const |
| Gets abbreviated era strings.More... | |
| U_I18N_API void | setEras (constUnicodeString *eras, int32_t count) |
| Sets abbreviated era strings.More... | |
| U_I18N_API constUnicodeString * | getEraNames (int32_t &count) const |
| Gets era name strings.More... | |
| U_I18N_API void | setEraNames (constUnicodeString *eraNames, int32_t count) |
| Sets era name strings.More... | |
| U_I18N_API constUnicodeString * | getNarrowEras (int32_t &count) const |
| Gets narrow era strings.More... | |
| U_I18N_API void | setNarrowEras (constUnicodeString *narrowEras, int32_t count) |
| Sets narrow era strings.More... | |
| U_I18N_API constUnicodeString * | getMonths (int32_t &count) const |
| Gets month strings.More... | |
| U_I18N_API void | setMonths (constUnicodeString *months, int32_t count) |
| Sets month strings.More... | |
| U_I18N_API constUnicodeString * | getShortMonths (int32_t &count) const |
| Gets short month strings.More... | |
| U_I18N_API void | setShortMonths (constUnicodeString *shortMonths, int32_t count) |
| Sets short month strings.More... | |
| U_I18N_API constUnicodeString * | getMonths (int32_t &count,DtContextType context,DtWidthType width) const |
| Gets month strings by width and context.More... | |
| U_I18N_API void | setMonths (constUnicodeString *months, int32_t count,DtContextType context,DtWidthType width) |
| Sets month strings by width and context.More... | |
| U_I18N_API constUnicodeString * | getWeekdays (int32_t &count) const |
| Gets wide weekday strings.More... | |
| U_I18N_API void | setWeekdays (constUnicodeString *weekdays, int32_t count) |
| Sets wide weekday strings.More... | |
| U_I18N_API constUnicodeString * | getShortWeekdays (int32_t &count) const |
| Gets abbreviated weekday strings.More... | |
| U_I18N_API void | setShortWeekdays (constUnicodeString *abbrevWeekdays, int32_t count) |
| Sets abbreviated weekday strings.More... | |
| U_I18N_API constUnicodeString * | getWeekdays (int32_t &count,DtContextType context,DtWidthType width) const |
| Gets weekday strings by width and context.More... | |
| U_I18N_API void | setWeekdays (constUnicodeString *weekdays, int32_t count,DtContextType context,DtWidthType width) |
| Sets weekday strings by width and context.More... | |
| U_I18N_API constUnicodeString * | getQuarters (int32_t &count,DtContextType context,DtWidthType width) const |
| Gets quarter strings by width and context.More... | |
| U_I18N_API void | setQuarters (constUnicodeString *quarters, int32_t count,DtContextType context,DtWidthType width) |
| Sets quarter strings by width and context.More... | |
| U_I18N_API constUnicodeString * | getAmPmStrings (int32_t &count) const |
| Gets AM/PM strings.More... | |
| U_I18N_API void | setAmPmStrings (constUnicodeString *ampms, int32_t count) |
| Sets ampm strings.More... | |
| U_I18N_API constUnicodeString * | getAmPmStrings (int32_t &count,DtContextType context,DtWidthType width) const |
| Gets AM/PM strings with the specified width.More... | |
| U_I18N_API void | setAmPmStrings (constUnicodeString *ampms, int32_t count,DtContextType context,DtWidthType width) |
| Sets AM/PM strings with the specified width.More... | |
| U_I18N_APIUnicodeString & | getTimeSeparatorString (UnicodeString &result) const |
| Gets the time separator string.More... | |
| U_I18N_API void | setTimeSeparatorString (constUnicodeString &newTimeSeparator) |
| Sets the time separator string.More... | |
| U_I18N_API constUnicodeString * | getYearNames (int32_t &count,DtContextType context,DtWidthType width) const |
| Gets cyclic year name strings if the calendar has them, by width and context.More... | |
| U_I18N_API void | setYearNames (constUnicodeString *yearNames, int32_t count,DtContextType context,DtWidthType width) |
| Sets cyclic year name strings by width and context.More... | |
| U_I18N_API constUnicodeString * | getZodiacNames (int32_t &count,DtContextType context,DtWidthType width) const |
| Gets calendar zodiac name strings if the calendar has them, by width and context.More... | |
| U_I18N_API void | setZodiacNames (constUnicodeString *zodiacNames, int32_t count,DtContextType context,DtWidthType width) |
| Sets calendar zodiac name strings by width and context.More... | |
| U_I18N_API constUnicodeString * | getLeapMonthPatterns (int32_t &count) const |
| Somewhat temporary function for getting complete set of leap month patterns for all contexts & widths, indexed by EMonthPatternType values.More... | |
| U_I18N_API constUnicodeString ** | getZoneStrings (int32_t &rowCount, int32_t &columnCount) const |
| Gets timezone strings.More... | |
| U_I18N_API void | setZoneStrings (constUnicodeString *const *strings, int32_t rowCount, int32_t columnCount) |
| Sets timezone strings.More... | |
| U_I18N_APIUnicodeString & | getLocalPatternChars (UnicodeString &result) const |
| Gets localized date-time pattern characters.More... | |
| U_I18N_API void | setLocalPatternChars (constUnicodeString &newLocalPatternChars) |
| Sets localized date-time pattern characters.More... | |
| U_I18N_APILocale | getLocale (ULocDataLocaleType type,UErrorCode &status) const |
| Returns the locale for this object.More... | |
| virtualU_I18N_APIUClassID | getDynamicClassID () const override |
| ICU "poor man's RTTI", returns a UClassID for the actual class.More... | |
Public Member Functions inherited fromicu::UObject | |
| virtual | ~UObject () |
| Destructor.More... | |
Static Public Member Functions | |
| staticU_I18N_API const char16_t * | getPatternUChars () |
| Get the non-localized date-time pattern characters.More... | |
| staticU_I18N_APIUClassID | getStaticClassID () |
| ICU "poor man's RTTI", returns a UClassID for this class.More... | |
| staticU_I18N_APIDateFormatSymbols * | createForLocale (constLocale &locale,UErrorCode &status) |
| Gets aDateFormatSymbols by locale.More... | |
Static Public Attributes | |
| staticU_I18N_API const char16_t | DEFAULT_TIME_SEPARATOR = 0x003a |
| This default time separator is used for formatting when the locale doesn't specify any time separator, and always recognized when parsing.More... | |
| staticU_I18N_API const char16_t | ALTERNATE_TIME_SEPARATOR = 0x002e |
| This alternate time separator is always recognized when parsing.More... | |
Friends | |
| class | SimpleDateFormat |
| class | DateFormatSymbolsSingleSetter |
DateFormatSymbols is a public class for encapsulating localizable date-time formatting data – including timezone data.
DateFormatSymbols is used byDateFormat andSimpleDateFormat.
Rather than first creating aDateFormatSymbols to get a date-time formatter by using aSimpleDateFormat constructor, clients are encouraged to create a date-time formatter using the getTimeInstance(), getDateInstance(), or getDateTimeInstance() method inDateFormat. 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, seeDateFormat.
If clients decide to create a date-time formatter with a particular format pattern and locale, they can do so with newSimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)). This will load the appropriate date-time formatting data from the locale.
DateFormatSymbols objects are clonable. When clients obtain aDateFormatSymbols 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 nullptr, 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 line84 of filedtfmtsym.h.
Selector for date formatting context.
| Enumerator | |
|---|---|
| DT_CONTEXT_COUNT | One more than the highest normal DtContextType value.
|
Definition at line274 of filedtfmtsym.h.
Selector for date formatting width.
| Enumerator | |
|---|---|
| SHORT | Short width is currently only supported for weekday names.
|
| DT_WIDTH_COUNT | One more than the highest normal DtWidthType value.
|
Definition at line290 of filedtfmtsym.h.
Constants for capitalization context usage types.
Definition at line651 of filedtfmtsym.h.
Somewhat temporary constants for leap month pattern types, adequate for supporting just leap month patterns as needed for Chinese lunar calendar.
Eventually we will add full support for different month pattern types (needed for other calendars such as Hindu) at which point this approach will be replaced by a more complete approach.
Definition at line557 of filedtfmtsym.h.
| U_I18N_API icu::DateFormatSymbols::DateFormatSymbols | ( | UErrorCode & | status | ) |
Construct aDateFormatSymbols 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.
| status | Status code. Failure results if the resources for the default cannot be found or cannot be loaded |
| U_I18N_API icu::DateFormatSymbols::DateFormatSymbols | ( | constLocale & | locale, |
| UErrorCode & | status | ||
| ) |
Construct aDateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).
| locale | Locale to load format data from. |
| status | Status code. Failure results if the resources for the locale cannot be found or cannot be loaded |
| U_I18N_API icu::DateFormatSymbols::DateFormatSymbols | ( | const char * | type, |
| UErrorCode & | status | ||
| ) |
Construct aDateFormatSymbols 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.
| type | Type of calendar (as returned byCalendar::getType). Will be used to access the correct set of strings. (nullptr or empty string defaults to "gregorian".) |
| status | Status code. Failure results if the resources for the default cannot be found or cannot be loaded |
| U_I18N_API icu::DateFormatSymbols::DateFormatSymbols | ( | constLocale & | locale, |
| const char * | type, | ||
| UErrorCode & | status | ||
| ) |
Construct aDateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).
| locale | Locale to load format data from. |
| type | Type of calendar (as returned byCalendar::getType). Will be used to access the correct set of strings. (nullptr or empty string defaults to "gregorian".) |
| status | Status code. Failure results if the resources for the locale cannot be found or cannot be loaded |
| U_I18N_API icu::DateFormatSymbols::DateFormatSymbols | ( | constDateFormatSymbols & | ) |
Copy constructor.
| virtual |
| static |
Gets aDateFormatSymbols by locale.
Unlike the constructors which always use gregorian calendar, this method uses the calendar in the locale. If the locale contains no explicit calendar, this method uses the default calendar for that locale.
| locale | the locale. |
| status | error returned here. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getAmPmStrings | ( | int32_t & | count | ) | const |
Gets AM/PM strings.
For example: "AM" and "PM".
| count | Filled in with length of the array. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getAmPmStrings | ( | int32_t & | count, |
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) | const |
Gets AM/PM strings with the specified width.
For example: "A" and "P".
| count | Filled in with length of the array. |
| context | The usage context. Currently ignored; FORMAT names always returned. |
| width | The width of returned strings, either WIDE, ABBREVIATED, or NARROW. |
| overridevirtual |
ICU "poor man's RTTI", returns a UClassID for the actual class.
Reimplemented fromicu::UObject.
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getEraNames | ( | int32_t & | count | ) | const |
Gets era name strings.
For example: "Anno Domini" and "Before Christ".
| count | Filled in with length of the array. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getEras | ( | int32_t & | count | ) | const |
Gets abbreviated era strings.
For example: "AD" and "BC".
| count | Filled in with length of the array. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getLeapMonthPatterns | ( | int32_t & | count | ) | const |
Somewhat temporary function for getting complete set of leap month patterns for all contexts & widths, indexed by EMonthPatternType values.
Returns nullptr if calendar does not have leap month patterns. Note, there is currently no setter for this. Eventually we will add full support for different month pattern types (needed for other calendars such as Hindu) at which point this approach will be replaced by a more complete approach.
| count | Filled in with length of the array (may be 0). |
| U_I18N_APILocale icu::DateFormatSymbols::getLocale | ( | ULocDataLocaleType | type, |
| UErrorCode & | status | ||
| ) | const |
Returns the locale for this object.
Two flavors are available: valid and actual locale.
| U_I18N_APIUnicodeString& icu::DateFormatSymbols::getLocalPatternChars | ( | UnicodeString & | result | ) | const |
Gets localized date-time pattern characters.
For example: 'u', 't', etc.
Note: ICU no longer provides localized date-time pattern characters for a locale starting ICU 3.8. This method returns the non-localized date-time pattern characters unless user defined localized data is set by setLocalPatternChars.
| result | Output param which will receive the localized date-time pattern characters. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getMonths | ( | int32_t & | count | ) | const |
Gets month strings.
For example: "January", "February", etc.
| count | Filled in with length of the array. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getMonths | ( | int32_t & | count, |
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) | const |
Gets month strings by width and context.
For example: "January", "February", etc.
| count | Filled in with length of the array. |
| context | The formatting context, either FORMAT or STANDALONE |
| width | The width of returned strings, either WIDE, ABBREVIATED, or NARROW. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getNarrowEras | ( | int32_t & | count | ) | const |
Gets narrow era strings.
For example: "A" and "B".
| count | Filled in with length of the array. |
| static |
Get the non-localized date-time pattern characters.
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getQuarters | ( | int32_t & | count, |
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) | const |
Gets quarter strings by width and context.
For example: "1st Quarter", "2nd Quarter", etc.
| count | Filled in with length of the array. |
| context | The formatting context, either FORMAT or STANDALONE |
| width | The width of returned strings, either WIDE, ABBREVIATED, or NARROW. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getShortMonths | ( | int32_t & | count | ) | const |
Gets short month strings.
For example: "Jan", "Feb", etc.
| count | Filled in with length of the array. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getShortWeekdays | ( | int32_t & | count | ) | const |
Gets abbreviated weekday strings.
For example: "Sun", "Mon", etc. (Note: The method name is misleading; it does not get the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)
| count | Filled in with length of the array. |
| static |
ICU "poor man's RTTI", returns a UClassID for this class.
| U_I18N_APIUnicodeString& icu::DateFormatSymbols::getTimeSeparatorString | ( | UnicodeString & | result | ) | const |
Gets the time separator string.
For example: ":".
| result | Output param which will receive the time separator string. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getWeekdays | ( | int32_t & | count | ) | const |
Gets wide weekday strings.
For example: "Sunday", "Monday", etc.
| count | Filled in with length of the array. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getWeekdays | ( | int32_t & | count, |
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) | const |
Gets weekday strings by width and context.
For example: "Sunday", "Monday", etc.
| count | Filled in with length of the array. |
| context | The formatting context, either FORMAT or STANDALONE |
| width | The width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getYearNames | ( | int32_t & | count, |
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) | const |
Gets cyclic year name strings if the calendar has them, by width and context.
For example: "jia-zi", "yi-chou", etc.
| count | Filled in with length of the array. |
| context | The usage context: FORMAT, STANDALONE. |
| width | The requested name width: WIDE, ABBREVIATED, NARROW. |
| U_I18N_API constUnicodeString* icu::DateFormatSymbols::getZodiacNames | ( | int32_t & | count, |
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) | const |
Gets calendar zodiac name strings if the calendar has them, by width and context.
For example: "Rat", "Ox", "Tiger", etc.
| count | Filled in with length of the array. |
| context | The usage context: FORMAT, STANDALONE. |
| width | The requested name width: WIDE, ABBREVIATED, NARROW. |
| U_I18N_API constUnicodeString** icu::DateFormatSymbols::getZoneStrings | ( | int32_t & | rowCount, |
| int32_t & | columnCount | ||
| ) | const |
Gets timezone strings.
These strings are stored in a 2-dimensional array.
| rowCount | Output param to receive number of rows. |
| columnCount | Output param to receive number of columns. |
| inline |
Return true if another object is semantically unequal to this one.
| other | theDateFormatSymbols object to be compared with. |
Definition at line183 of filedtfmtsym.h.
Referencesicu::operator==().
| U_I18N_APIDateFormatSymbols& icu::DateFormatSymbols::operator= | ( | constDateFormatSymbols & | ) |
Assignment operator.
| U_I18N_API bool icu::DateFormatSymbols::operator== | ( | constDateFormatSymbols & | other | ) | const |
Return true if another object is semantically equal to this one.
| other | theDateFormatSymbols object to be compared with. |
| U_I18N_API void icu::DateFormatSymbols::setAmPmStrings | ( | constUnicodeString * | ampms, |
| int32_t | count | ||
| ) |
Sets ampm strings.
For example: "AM" and "PM".
| ampms | The new ampm strings. (not adopted; caller retains ownership) |
| count | The number of strings in the array. |
| U_I18N_API void icu::DateFormatSymbols::setAmPmStrings | ( | constUnicodeString * | ampms, |
| int32_t | count, | ||
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) |
Sets AM/PM strings with the specified width.
For example: "A" and "P".
| ampms | The new AM/PM strings. (not adopted; caller retains ownership) |
| count | The number of strings in the array. |
| context | The usage context. Currently ignored; always sets FORMAT names. |
| width | The width of set strings, either WIDE, ABBREVIATED, or NARROW. |
| U_I18N_API void icu::DateFormatSymbols::setEraNames | ( | constUnicodeString * | eraNames, |
| int32_t | count | ||
| ) |
Sets era name strings.
For example: "Anno Domini" and "Before Christ".
| eraNames | Array of era name strings (DateFormatSymbols retains ownership.) |
| count | Filled in with length of the array. |
| U_I18N_API void icu::DateFormatSymbols::setEras | ( | constUnicodeString * | eras, |
| int32_t | count | ||
| ) |
Sets abbreviated era strings.
For example: "AD" and "BC".
| eras | Array of era strings (DateFormatSymbols retains ownership.) |
| count | Filled in with length of the array. |
| U_I18N_API void icu::DateFormatSymbols::setLocalPatternChars | ( | constUnicodeString & | newLocalPatternChars | ) |
Sets localized date-time pattern characters.
For example: 'u', 't', etc.
| newLocalPatternChars | the new localized date-time pattern characters. |
| U_I18N_API void icu::DateFormatSymbols::setMonths | ( | constUnicodeString * | months, |
| int32_t | count | ||
| ) |
Sets month strings.
For example: "January", "February", etc.
| months | the new month strings. (not adopted; caller retains ownership) |
| count | Filled in with length of the array. |
| U_I18N_API void icu::DateFormatSymbols::setMonths | ( | constUnicodeString * | months, |
| int32_t | count, | ||
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) |
Sets month strings by width and context.
For example: "January", "February", etc.
| months | The new month strings. (not adopted; caller retains ownership) |
| count | Filled in with length of the array. |
| context | The formatting context, either FORMAT or STANDALONE |
| width | The width of returned strings, either WIDE, ABBREVIATED, or NARROW. |
| U_I18N_API void icu::DateFormatSymbols::setNarrowEras | ( | constUnicodeString * | narrowEras, |
| int32_t | count | ||
| ) |
Sets narrow era strings.
For example: "A" and "B".
| narrowEras | Array of narrow era strings (DateFormatSymbols retains ownership.) |
| count | Filled in with length of the array. |
| U_I18N_API void icu::DateFormatSymbols::setQuarters | ( | constUnicodeString * | quarters, |
| int32_t | count, | ||
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) |
Sets quarter strings by width and context.
For example: "1st Quarter", "2nd Quarter", etc.
| quarters | The new quarter strings. (not adopted; caller retains ownership) |
| count | The number of strings in the array. |
| context | The formatting context, either FORMAT or STANDALONE |
| width | The width of set strings, either WIDE, ABBREVIATED, or NARROW. |
| U_I18N_API void icu::DateFormatSymbols::setShortMonths | ( | constUnicodeString * | shortMonths, |
| int32_t | count | ||
| ) |
Sets short month strings.
For example: "Jan", "Feb", etc.
| count | Filled in with length of the array. |
| shortMonths | the new short month strings. (not adopted; caller retains ownership) |
| U_I18N_API void icu::DateFormatSymbols::setShortWeekdays | ( | constUnicodeString * | abbrevWeekdays, |
| int32_t | count | ||
| ) |
Sets abbreviated weekday strings.
For example: "Sun", "Mon", etc. (Note: The method name is misleading; it does not set the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)
| abbrevWeekdays | the new abbreviated weekday strings. (not adopted; caller retains ownership) |
| count | Filled in with length of the array. |
| U_I18N_API void icu::DateFormatSymbols::setTimeSeparatorString | ( | constUnicodeString & | newTimeSeparator | ) |
Sets the time separator string.
For example: ":".
| newTimeSeparator | the new time separator string. |
| U_I18N_API void icu::DateFormatSymbols::setWeekdays | ( | constUnicodeString * | weekdays, |
| int32_t | count | ||
| ) |
Sets wide weekday strings.
For example: "Sunday", "Monday", etc.
| weekdays | the new weekday strings. (not adopted; caller retains ownership) |
| count | Filled in with length of the array. |
| U_I18N_API void icu::DateFormatSymbols::setWeekdays | ( | constUnicodeString * | weekdays, |
| int32_t | count, | ||
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) |
Sets weekday strings by width and context.
For example: "Sunday", "Monday", etc.
| weekdays | The new weekday strings. (not adopted; caller retains ownership) |
| count | Filled in with length of the array. |
| context | The formatting context, either FORMAT or STANDALONE |
| width | The width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW |
| U_I18N_API void icu::DateFormatSymbols::setYearNames | ( | constUnicodeString * | yearNames, |
| int32_t | count, | ||
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) |
Sets cyclic year name strings by width and context.
For example: "jia-zi", "yi-chou", etc.
| yearNames | The new cyclic year name strings (not adopted; caller retains ownership). |
| count | The length of the array. |
| context | The usage context: FORMAT, STANDALONE (currently only FORMAT is supported). |
| width | The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported). |
| U_I18N_API void icu::DateFormatSymbols::setZodiacNames | ( | constUnicodeString * | zodiacNames, |
| int32_t | count, | ||
| DtContextType | context, | ||
| DtWidthType | width | ||
| ) |
Sets calendar zodiac name strings by width and context.
For example: "Rat", "Ox", "Tiger", etc.
| zodiacNames | The new zodiac name strings (not adopted; caller retains ownership). |
| count | The length of the array. |
| context | The usage context: FORMAT, STANDALONE (currently only FORMAT is supported). |
| width | The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported). |
| U_I18N_API void icu::DateFormatSymbols::setZoneStrings | ( | constUnicodeString *const * | strings, |
| int32_t | rowCount, | ||
| int32_t | columnCount | ||
| ) |
Sets timezone strings.
These strings are stored in a 2-dimensional array.
Note:SimpleDateFormat no longer use the zone strings stored in aDateFormatSymbols. Therefore, the time zone strings set by this method have no effects in an instance ofSimpleDateFormat for formatting time zones.
| strings | The timezone strings as a 2-d array to be copied. (not adopted; caller retains ownership) |
| rowCount | The number of rows (count of first index). |
| columnCount | The number of columns (count of second index). |
| static |
This alternate time separator is always recognized when parsing.
Definition at line474 of filedtfmtsym.h.
| static |
This default time separator is used for formatting when the locale doesn't specify any time separator, and always recognized when parsing.
Definition at line468 of filedtfmtsym.h.