Index: source/i18n/unicode/calendar.h |
diff --git a/source/i18n/unicode/calendar.h b/source/i18n/unicode/calendar.h |
index b3c9587f5b002bd17825e6fd2b2900f7f9acaf96..e8ebaae0acb34da1e6360e7581f2f80b0dbcfd28 100644 |
--- a/source/i18n/unicode/calendar.h |
+++ b/source/i18n/unicode/calendar.h |
@@ -1,6 +1,6 @@ |
/* |
******************************************************************************** |
-* Copyright (C) 1997-2013, International Business Machines |
+* Copyright (C) 1997-2014, International Business Machines |
* Corporation and others. All Rights Reserved. |
******************************************************************************** |
* |
@@ -1713,6 +1713,16 @@ protected: |
*/ |
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 |
+ * <code>Calendar::validateField()</code>. |
+ * @see #validateField(int, int, int, int&) |
+ * @internal |
+ */ |
+ virtual void validateField(UCalendarDateFields field, UErrorCode &status); |
+ |
#ifndef U_HIDE_INTERNAL_API |
/** |
* Compute the Julian day from fields. Will determine whether to use |
@@ -2154,7 +2164,7 @@ 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; |
@@ -2293,16 +2303,6 @@ private: |
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 |
- * <code>Calendar::validateField()</code>. |
- * @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, |
* <code>U_ILLEGAL_ARGUMENT_ERROR</code> will be set. Subclasses may |
@@ -2348,6 +2348,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 +2365,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 |
@@ -2412,6 +2422,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) |
@@ -2428,6 +2452,15 @@ private: |
* is not an instance of BasicTimeZone. |
*/ |
BasicTimeZone* getBasicTimeZone() const; |
+ |
+ /** |
+ * Find the previous zone transtion 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; |
}; |
// ------------------------------------- |
@@ -2453,7 +2486,7 @@ Calendar::roll(EDateFields field, UBool up, UErrorCode& status) |
{ |
roll((UCalendarDateFields) field, up, status); |
} |
-#endif |
+#endif /* U_HIDE_DEPRECATED_API */ |
// ------------------------------------- |
@@ -2477,7 +2510,7 @@ 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 |