X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/e4f10fab0c078f399c9deef476d9c9b73b47dff8..HEAD:/icuSources/i18n/unicode/calendar.h diff --git a/icuSources/i18n/unicode/calendar.h b/icuSources/i18n/unicode/calendar.h index 24b0cbef..0ce11898 100644 --- a/icuSources/i18n/unicode/calendar.h +++ b/icuSources/i18n/unicode/calendar.h @@ -1,3 +1,5 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** * Copyright (C) 1997-2014, International Business Machines @@ -27,8 +29,10 @@ #include "unicode/utypes.h" +#if U_SHOW_CPLUSPLUS_API + /** - * \file + * \file * \brief C++ API: Calendar object */ #if !UCONFIG_NO_FORMATTING @@ -50,156 +54,139 @@ typedef int32_t UFieldResolutionTable[12][8]; class BasicTimeZone; /** - * Calendar is an abstract base class for converting between - * a UDate object and a set of integer fields such as - * YEAR, MONTH, DAY, HOUR, - * and so on. (A UDate object represents a specific instant in + * `Calendar` is an abstract base class for converting between + * a `UDate` object and a set of integer fields such as + * `YEAR`, `MONTH`, `DAY`, `HOUR`, and so on. + * (A `UDate` object represents a specific instant in * time with millisecond precision. See UDate - * for information about the UDate class.) + * for information about the `UDate` class.) * - *

- * Subclasses of Calendar interpret a UDate + * Subclasses of `Calendar` interpret a `UDate` * according to the rules of a specific calendar system. - * The most commonly used subclass of Calendar is - * GregorianCalendar. Other subclasses could represent + * The most commonly used subclass of `Calendar` is + * `GregorianCalendar`. Other subclasses could represent * the various types of lunar calendars in use in many parts of the world. * - *

- * NOTE: (ICU 2.6) The subclass interface should be considered unstable - * - it WILL change. + * **NOTE**: (ICU 2.6) The subclass interface should be considered unstable - + * it WILL change. * - *

- * Like other locale-sensitive classes, Calendar provides a - * static method, createInstance, for getting a generally useful - * object of this type. Calendar's createInstance method - * returns the appropriate Calendar subclass whose + * Like other locale-sensitive classes, `Calendar` provides a + * static method, `createInstance`, for getting a generally useful + * object of this type. `Calendar`'s `createInstance` method + * returns the appropriate `Calendar` subclass whose * time fields have been initialized with the current date and time: - * \htmlonly

\endhtmlonly - *
- * Calendar *rightNow = Calendar::createInstance(errCode);
- * 
- * \htmlonly
\endhtmlonly * - *

- * A Calendar object can produce all the time field values + * Calendar *rightNow = Calendar::createInstance(errCode); + * + * A `Calendar` object can produce all the time field values * needed to implement the date-time formatting for a particular language * and calendar style (for example, Japanese-Gregorian, Japanese-Traditional). * - *

- * When computing a UDate from time fields, some special circumstances + * When computing a `UDate` from time fields, some special circumstances * may arise: there may be insufficient information to compute the - * UDate (such as only year and month but no day in the month), + * `UDate` (such as only year and month but no day in the month), * there may be inconsistent information (such as "Tuesday, July 15, 1996" * -- July 15, 1996 is actually a Monday), or the input time might be ambiguous * because of time zone transition. * - *

- * Insufficient information. The calendar will use default + * **Insufficient information.** The calendar will use default * information to specify the missing fields. This may vary by calendar; for * the Gregorian calendar, the default for a field is the same as that of the * start of the epoch: i.e., YEAR = 1970, MONTH = JANUARY, DATE = 1, etc. * - *

- * Inconsistent information. If fields conflict, the calendar + * **Inconsistent information.** If fields conflict, the calendar * will give preference to fields set more recently. For example, when * determining the day, the calendar will look for one of the following * combinations of fields. The most recent combination, as determined by the * most recently set single field, will be used. * - * \htmlonly

\endhtmlonly - *
- * MONTH + DAY_OF_MONTH
- * MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
- * MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
- * DAY_OF_YEAR
- * DAY_OF_WEEK + WEEK_OF_YEAR
- * 
- * \htmlonly
\endhtmlonly + * MONTH + DAY_OF_MONTH + * MONTH + WEEK_OF_MONTH + DAY_OF_WEEK + * MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK + * DAY_OF_YEAR + * DAY_OF_WEEK + WEEK_OF_YEAR * * For the time of day: * - * \htmlonly
\endhtmlonly - *
- * HOUR_OF_DAY
- * AM_PM + HOUR
- * 
- * \htmlonly
\endhtmlonly + * HOUR_OF_DAY + * AM_PM + HOUR * - *

- * Ambiguous Wall Clock Time. When time offset from UTC has - * changed, it produces ambiguous time slot around the transition. For example, + * **Ambiguous Wall Clock Time.** When time offset from UTC has + * changed, it produces an ambiguous time slot around the transition. For example, * many US locations observe daylight saving time. On the date switching to daylight - * saving time in US, wall clock time jumps from 1:00 AM (standard) to 2:00 AM + * saving time in US, wall clock time jumps from 12:59 AM (standard) to 2:00 AM * (daylight). Therefore, wall clock time from 1:00 AM to 1:59 AM do not exist on * the date. When the input wall time fall into this missing time slot, the ICU * Calendar resolves the time using the UTC offset before the transition by default. * In this example, 1:30 AM is interpreted as 1:30 AM standard time (non-exist), * so the final result will be 2:30 AM daylight time. - * - *

On the date switching back to standard time, wall clock time is moved back one + * + * On the date switching back to standard time, wall clock time is moved back one * hour at 2:00 AM. So wall clock time from 1:00 AM to 1:59 AM occur twice. In this * case, the ICU Calendar resolves the time using the UTC offset after the transition * by default. For example, 1:30 AM on the date is resolved as 1:30 AM standard time. * - *

Ambiguous wall clock time resolution behaviors can be customized by Calendar APIs + * Ambiguous wall clock time resolution behaviors can be customized by Calendar APIs * {@link #setRepeatedWallTimeOption} and {@link #setSkippedWallTimeOption}. * These methods are available in ICU 49 or later versions. * - *

- * Note: for some non-Gregorian calendars, different + * **Note:** for some non-Gregorian calendars, different * fields may be necessary for complete disambiguation. For example, a full - * specification of the historial Arabic astronomical calendar requires year, - * month, day-of-month and day-of-week in some cases. + * specification of the historical Arabic astronomical calendar requires year, + * month, day-of-month *and* day-of-week in some cases. * - *

- * Note: There are certain possible ambiguities in + * **Note:** There are certain possible ambiguities in * interpretation of certain singular times, which are resolved in the * following ways: - *

    - *
  1. 24:00:00 "belongs" to the following day. That is, - * 23:59 on Dec 31, 1969 < 24:00 on Jan 1, 1970 < 24:01:00 on Jan 1, 1970 * - *
  2. Although historically not precise, midnight also belongs to "am", - * and noon belongs to "pm", so on the same day, - * 12:00 am (midnight) < 12:01 am, and 12:00 pm (noon) < 12:01 pm - *
+ * 1. 24:00:00 "belongs" to the following day. That is, + * 23:59 on Dec 31, 1969 < 24:00 on Jan 1, 1970 < 24:01:00 on Jan 1, 1970 + * 2. Although historically not precise, midnight also belongs to "am", + * and noon belongs to "pm", so on the same day, + * 12:00 am (midnight) < 12:01 am, and 12:00 pm (noon) < 12:01 pm * - *

* The date or time format strings are not part of the definition of a * calendar, as those must be modifiable or overridable by the user at - * runtime. Use {@link DateFormat} - * to format dates. + * runtime. Use `DateFormat` to format dates. * - *

- * Calendar provides an API for field "rolling", where fields + * `Calendar` provides an API for field "rolling", where fields * can be incremented or decremented, but wrap around. For example, rolling the - * month up in the date December 12, 1996 results in - * January 12, 1996. + * month up in the date December 12, **1996** results in + * January 12, **1996**. * - *

- * Calendar also provides a date arithmetic function for + * `Calendar` also provides a date arithmetic function for * adding the specified (signed) amount of time to a particular time field. - * For example, subtracting 5 days from the date September 12, 1996 - * results in September 7, 1996. + * For example, subtracting 5 days from the date `September 12, 1996` + * results in `September 7, 1996`. * - *

Supported range + * ***Supported range*** * - *

The allowable range of Calendar has been - * narrowed. GregorianCalendar used to attempt to support - * the range of dates with millisecond values from - * Long.MIN_VALUE to Long.MAX_VALUE. - * The new Calendar protocol specifies the + * The allowable range of `Calendar` has been narrowed. `GregorianCalendar` used + * to attempt to support the range of dates with millisecond values from + * `Long.MIN_VALUE` to `Long.MAX_VALUE`. The new `Calendar` protocol specifies the * maximum range of supportable dates as those having Julian day numbers - * of -0x7F000000 to +0x7F000000. This - * corresponds to years from ~5,800,000 BCE to ~5,800,000 CE. Programmers - * should use the protected constants in Calendar to - * specify an extremely early or extremely late date.

+ * of `-0x7F000000` to `+0x7F000000`. This corresponds to years from ~5,800,000 BCE + * to ~5,800,000 CE. Programmers should use the protected constants in `Calendar` to + * specify an extremely early or extremely late date. + * + *

+ * The Japanese calendar uses a combination of era name and year number. + * When an emperor of Japan abdicates and a new emperor ascends the throne, + * a new era is declared and year number is reset to 1. Even if the date of + * abdication is scheduled ahead of time, the new era name might not be + * announced until just before the date. In such case, ICU4C may include + * a start date of future era without actual era name, but not enabled + * by default. ICU4C users who want to test the behavior of the future era + * can enable the tentative era by: + *

* * @stable ICU 2.0 */ class U_I18N_API Calendar : public UObject { public: - +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * Field IDs for date and time. Used to specify date/time fields. ERA is calendar * specific. Example ranges given are for illustration only; see specific Calendar @@ -233,7 +220,7 @@ public: DST_OFFSET, // Example: 0 or U_MILLIS_PER_HOUR YEAR_WOY, // 'Y' Example: 1..big number - Year of Week of Year DOW_LOCAL, // 'e' Example: 1..7 - Day of Week / Localized - + EXTENDED_YEAR, JULIAN_DAY, MILLISECONDS_IN_DAY, @@ -242,6 +229,7 @@ public: FIELD_COUNT = UCAL_FIELD_COUNT // See ucal.h for other fields. #endif /* U_HIDE_DEPRECATED_API */ }; +#endif // U_FORCE_HIDE_DEPRECATED_API #ifndef U_HIDE_DEPRECATED_API /** @@ -302,7 +290,7 @@ public: * @return a polymorphic copy of this calendar. * @stable ICU 2.0 */ - virtual Calendar* clone(void) const = 0; + virtual Calendar* clone() const = 0; /** * Creates a Calendar using the default timezone and locale. Clients are responsible @@ -533,6 +521,7 @@ public: */ UBool after(const Calendar& when, UErrorCode& status) const; +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * UDate Arithmetic function. Adds the specified (signed) amount of time to the given * time field, based on the calendar's rules. For example, to subtract 5 days from @@ -554,6 +543,7 @@ public: * @deprecated ICU 2.6. use add(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead. */ virtual void add(EDateFields field, int32_t amount, UErrorCode& status); +#endif // U_FORCE_HIDE_DEPRECATED_API /** * UDate Arithmetic function. Adds the specified (signed) amount of time to the given @@ -647,6 +637,7 @@ public: */ inline void roll(UCalendarDateFields field, UBool up, UErrorCode& status); +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * Time Field Rolling function. Rolls by the given amount on the given * time field. For example, to roll the current date up by one day, call @@ -679,6 +670,7 @@ public: * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead. */ virtual void roll(EDateFields field, int32_t amount, UErrorCode& status); +#endif // U_FORCE_HIDE_DEPRECATED_API /** * Time Field Rolling function. Rolls by the given amount on the given @@ -713,6 +705,7 @@ public: */ virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status); +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * Return the difference between the given time and the time this * calendar object is set to. If this calendar is set @@ -769,6 +762,7 @@ public: * @deprecated ICU 2.6. Use fieldDifference(UDate when, UCalendarDateFields field, UErrorCode& status). */ virtual int32_t fieldDifference(UDate when, EDateFields field, UErrorCode& status); +#endif // U_FORCE_HIDE_DEPRECATED_API /** * Return the difference between the given time and the time this @@ -901,7 +895,7 @@ public: /** * Sets the behavior for handling wall time repeating multiple times * at negative time zone offset transitions. For example, 1:30 AM on - * November 6, 2011 in US Eastern time (Ameirca/New_York) occurs twice; + * November 6, 2011 in US Eastern time (America/New_York) occurs twice; * 1:30 AM EDT, then 1:30 AM EST one hour later. When UCAL_WALLTIME_FIRST * is used, the wall time 1:30AM in this example will be interpreted as 1:30 AM EDT * (first occurrence). When UCAL_WALLTIME_LAST is used, it will be @@ -912,7 +906,7 @@ public: * option for this. When the argument is neither UCAL_WALLTIME_FIRST * nor UCAL_WALLTIME_LAST, this method has no effect and will keep * the current setting. - * + * * @param option the behavior for handling repeating wall time, either * UCAL_WALLTIME_FIRST or UCAL_WALLTIME_LAST. * @see #getRepeatedWallTimeOption @@ -923,7 +917,7 @@ public: /** * Gets the behavior for handling wall time repeating multiple times * at negative time zone offset transitions. - * + * * @return the behavior for handling repeating wall time, either * UCAL_WALLTIME_FIRST or UCAL_WALLTIME_LAST. * @see #setRepeatedWallTimeOption @@ -944,12 +938,12 @@ public: *

* Note:This option is effective only when this calendar is lenient. * When the calendar is strict, such non-existing wall time will cause an error. - * + * * @param option the behavior for handling skipped wall time at positive time zone * offset transitions, one of UCAL_WALLTIME_FIRST, UCAL_WALLTIME_LAST and * UCAL_WALLTIME_NEXT_VALID. * @see #getSkippedWallTimeOption - * + * * @stable ICU 49 */ void setSkippedWallTimeOption(UCalendarWallTimeOption option); @@ -957,7 +951,7 @@ public: /** * Gets the behavior for handling skipped wall time at positive time zone offset * transitions. - * + * * @return the behavior for handling skipped wall time, one of * UCAL_WALLTIME_FIRST, UCAL_WALLTIME_LAST * and UCAL_WALLTIME_NEXT_VALID. @@ -1025,6 +1019,7 @@ public: */ uint8_t getMinimalDaysInFirstWeek(void) const; +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * Gets the minimum value for the given time field. e.g., for Gregorian * DAY_OF_MONTH, 1. @@ -1034,6 +1029,7 @@ public: * @deprecated ICU 2.6. Use getMinimum(UCalendarDateFields field) instead. */ virtual int32_t getMinimum(EDateFields field) const; +#endif // U_FORCE_HIDE_DEPRECATED_API /** * Gets the minimum value for the given time field. e.g., for Gregorian @@ -1045,6 +1041,7 @@ public: */ virtual int32_t getMinimum(UCalendarDateFields field) const; +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * Gets the maximum value for the given time field. e.g. for Gregorian DAY_OF_MONTH, * 31. @@ -1054,6 +1051,7 @@ public: * @deprecated ICU 2.6. Use getMaximum(UCalendarDateFields field) instead. */ virtual int32_t getMaximum(EDateFields field) const; +#endif // U_FORCE_HIDE_DEPRECATED_API /** * Gets the maximum value for the given time field. e.g. for Gregorian DAY_OF_MONTH, @@ -1065,6 +1063,7 @@ public: */ virtual int32_t getMaximum(UCalendarDateFields field) const; +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * Gets the highest minimum value for the given field if varies. Otherwise same as * getMinimum(). For Gregorian, no difference. @@ -1074,6 +1073,7 @@ public: * @deprecated ICU 2.6. Use getGreatestMinimum(UCalendarDateFields field) instead. */ virtual int32_t getGreatestMinimum(EDateFields field) const; +#endif // U_FORCE_HIDE_DEPRECATED_API /** * Gets the highest minimum value for the given field if varies. Otherwise same as @@ -1085,6 +1085,7 @@ public: */ virtual int32_t getGreatestMinimum(UCalendarDateFields field) const; +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * Gets the lowest maximum value for the given field if varies. Otherwise same as * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28. @@ -1094,6 +1095,7 @@ public: * @deprecated ICU 2.6. Use getLeastMaximum(UCalendarDateFields field) instead. */ virtual int32_t getLeastMaximum(EDateFields field) const; +#endif // U_FORCE_HIDE_DEPRECATED_API /** * Gets the lowest maximum value for the given field if varies. Otherwise same as @@ -1294,8 +1296,17 @@ public: /** * Clears the values of all the time fields, making them both unset and assigning - * them a value of zero. The field values will be determined during the next - * resolving of time into time fields. + * them a value of zero (except for era in some cases, see below). The field values + * will be determined during the next resolving of time into time fields. + * + * This effectively results in the following: + * 1. Gregorian-like calendars (gregorian, iso8601, japanese, buddhist, roc) are set + * to a UDate value of 0, corresponding to the epoch date of gregorian + * January 1, 1970 CE at UTC 00:00:00. + * 2. Other calendars are set to the beginning of the first day of the first month of + * the current era. Note that for the chinese and dangi calendars, the era + * corresponds to the current 60-year stem-branch cycle, so there is a new era + * every 60 years. The current era began on gregorian February 2, 1984. * @stable ICU 2.0 */ void clear(void); @@ -1708,11 +1719,19 @@ protected: * (YEAR_WOY and WEEK_OF_YEAR) to an extended year in the case * where YEAR, EXTENDED_YEAR are not set. * The Calendar implementation assumes yearWoy is in extended gregorian form - * @internal * @return the extended year, UCAL_EXTENDED_YEAR + * @internal */ virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy); + /** + * Validate a single field of this calendar. Subclasses should + * override this method to validate any calendar-specific fields. + * Generic fields can be handled by `Calendar::validateField()`. + * @internal + */ + virtual void validateField(UCalendarDateFields field, UErrorCode &status); + #ifndef U_HIDE_INTERNAL_API /** * Compute the Julian day from fields. Will determine whether to use @@ -1729,7 +1748,7 @@ protected: * reflects local zone wall time. * @internal */ - int32_t computeMillisInDay(); + double computeMillisInDay(); /** * This method can assume EXTENDED_YEAR has been set. @@ -1740,7 +1759,7 @@ protected: * when this function fails. * @internal */ - int32_t computeZoneOffset(double millis, int32_t millisInDay, UErrorCode &ec); + int32_t computeZoneOffset(double millis, double millisInDay, UErrorCode &ec); /** @@ -1902,11 +1921,13 @@ protected: */ int32_t fFields[UCAL_FIELD_COUNT]; +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * The flags which tell if a specified time field for the calendar is set. * @deprecated ICU 2.8 use (fStamp[n]!=kUnset) */ UBool fIsSet[UCAL_FIELD_COUNT]; +#endif // U_FORCE_HIDE_DEPRECATED_API /** Special values of stamp[] * @stable ICU 2.0 @@ -2154,12 +2175,12 @@ private: /** * Time zone affects the time calculation done by Calendar. Calendar subclasses use - * the time zone data to produce the local time. + * the time zone data to produce the local time. Always set; never NULL. */ TimeZone* fZone; /** - * Option for rpeated wall time + * Option for repeated wall time * @see #setRepeatedWallTimeOption */ UCalendarWallTimeOption fRepeatedWallTime; @@ -2288,27 +2309,15 @@ private: * should only be called if this calendar is not lenient. * @see #isLenient * @see #validateField(int, int&) - * @internal */ void validateFields(UErrorCode &status); - /** - * Validate a single field of this calendar. Subclasses should - * override this method to validate any calendar-specific fields. - * Generic fields can be handled by - * Calendar::validateField(). - * @see #validateField(int, int, int, int&) - * @internal - */ - virtual void validateField(UCalendarDateFields field, UErrorCode &status); - /** * Validate a single field of this calendar given its minimum and * maximum allowed value. If the field is out of range, * U_ILLEGAL_ARGUMENT_ERROR will be set. Subclasses may * use this method in their implementation of {@link * #validateField(int, int&)}. - * @internal */ void validateField(UCalendarDateFields field, int32_t min, int32_t max, UErrorCode& status); @@ -2348,6 +2357,11 @@ private: /** * Register a new Calendar factory. The factory will be adopted. * INTERNAL in 2.6 + * + * Because ICU may choose to cache Calendars internally, this must + * be called at application startup, prior to any calls to + * Calendar::createInstance to avoid undefined behavior. + * * @param toAdopt the factory instance to be adopted * @param status the in/out status code, no special meanings are assigned * @return a registry key that can be used to unregister this factory @@ -2360,6 +2374,11 @@ private: * register call. Key becomes invalid after a successful call and should not be used again. * The CalendarFactory corresponding to the key will be deleted. * INTERNAL in 2.6 + * + * Because ICU may choose to cache Calendars internally, this should + * be called during application shutdown, after all calls to + * Calendar::createInstance to avoid undefined behavior. + * * @param key the registry key returned by a previous call to registerFactory * @param status the in/out status code, no special meanings are assigned * @return TRUE if the factory for the key was successfully unregistered @@ -2388,19 +2407,19 @@ private: #endif /* !UCONFIG_NO_SERVICE */ /** - * @internal * @return TRUE if this calendar has a default century (i.e. 03 -> 2003) + * @internal */ virtual UBool haveDefaultCentury() const = 0; /** - * @internal * @return the start of the default century, as a UDate + * @internal */ virtual UDate defaultCenturyStart() const = 0; /** - * @internal * @return the beginning year of the default century, as a year + * @internal */ virtual int32_t defaultCenturyStartYear() const = 0; @@ -2412,6 +2431,20 @@ private: */ Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const; + /** + * @return The related Gregorian year; will be obtained by modifying the value + * obtained by get from UCAL_EXTENDED_YEAR field + * @internal + */ + virtual int32_t getRelatedYear(UErrorCode &status) const; + + /** + * @param year The related Gregorian year to set; will be modified as necessary then + * set in UCAL_EXTENDED_YEAR field + * @internal + */ + virtual void setRelatedYear(int32_t year); + #ifndef U_HIDE_INTERNAL_API /** Get the locale for this calendar object. You can choose between valid and actual locale. * @param type type of the locale we're looking for (valid or actual) @@ -2430,13 +2463,43 @@ private: BasicTimeZone* getBasicTimeZone() const; /** - * Find the previous zone transtion near the given time. + * Find the previous zone transition near the given time. * @param base The base time, inclusive * @param transitionTime Receives the result time * @param status The error status * @return TRUE if a transition is found. */ UBool getImmediatePreviousZoneTransition(UDate base, UDate *transitionTime, UErrorCode& status) const; + +public: +#ifndef U_HIDE_INTERNAL_API + /** + * Creates a new Calendar from a Locale for the cache. + * This method does not set the time or timezone in returned calendar. + * @param locale the locale. + * @param status any error returned here. + * @return the new Calendar object with no time or timezone set. + * @internal For ICU use only. + */ + static Calendar * U_EXPORT2 makeInstance( + const Locale &locale, UErrorCode &status); + + /** + * Get the calendar type for given locale. + * @param locale the locale + * @param typeBuffer calendar type returned here + * @param typeBufferSize The size of typeBuffer in bytes. If the type + * can't fit in the buffer, this method sets status to + * U_BUFFER_OVERFLOW_ERROR + * @param status error, if any, returned here. + * @internal For ICU use only. + */ + static void U_EXPORT2 getCalendarTypeFromLocale( + const Locale &locale, + char *typeBuffer, + int32_t typeBufferSize, + UErrorCode &status); +#endif /* U_HIDE_INTERNAL_API */ }; // ------------------------------------- @@ -2462,7 +2525,7 @@ Calendar::roll(EDateFields field, UBool up, UErrorCode& status) { roll((UCalendarDateFields) field, up, status); } -#endif +#endif /* U_HIDE_DEPRECATED_API */ // ------------------------------------- @@ -2486,10 +2549,12 @@ inline int32_t Calendar::weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek) { return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek); } -#endif +#endif /* U_HIDE_INTERNAL_API */ U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ +#endif /* U_SHOW_CPLUSPLUS_API */ + #endif // _CALENDAR