ICU-2424 fix cleanup definitions, implement roll(EDateFields) pure virtual
X-SVN-Rev: 13861
This commit is contained in:
parent
7c8e0c18d7
commit
1c96a4be04
@ -1235,6 +1235,13 @@ void Calendar::handleComputeFields(int32_t /* julianDay */, UErrorCode &/* statu
|
||||
internalSet(UCAL_YEAR, eyear);
|
||||
}
|
||||
// -------------------------------------
|
||||
|
||||
|
||||
void Calendar::roll(EDateFields field, int32_t amount, UErrorCode& status)
|
||||
{
|
||||
roll((UCalendarDateFields)field, amount, status);
|
||||
}
|
||||
|
||||
void Calendar::roll(UCalendarDateFields field, int32_t amount, UErrorCode& status)
|
||||
{
|
||||
if (amount == 0) {
|
||||
@ -2972,6 +2979,10 @@ Calendar::getLocaleInternal(ULocDataLocaleType type, UErrorCode &status) const
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
// INTERNAL - for cleanup
|
||||
// clean up the astronomical data & cache
|
||||
U_CFUNC UBool calendar_islamic_cleanup(void);
|
||||
|
||||
U_CFUNC UBool calendar_cleanup(void) {
|
||||
calendar_islamic_cleanup();
|
||||
if (gService) {
|
||||
|
@ -103,9 +103,6 @@ U_NAMESPACE_BEGIN
|
||||
|
||||
// Implementation of the IslamicCalendar class
|
||||
|
||||
const char IslamicCalendar::fgClassID = 0; // Value is irrelevant
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Constructors...
|
||||
//-------------------------------------------------------------------------
|
||||
@ -463,16 +460,6 @@ if (U_FAILURE(status) || !getTimeZone().useDaylightTime())
|
||||
return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : FALSE);
|
||||
}
|
||||
|
||||
|
||||
// deprecated
|
||||
void
|
||||
IslamicCalendar::roll(EDateFields field, int32_t amount, UErrorCode& status) {
|
||||
Calendar::roll((UCalendarDateFields) field, amount, status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// default century
|
||||
const UDate IslamicCalendar::fgSystemDefaultCentury = DBL_MIN;
|
||||
const int32_t IslamicCalendar::fgSystemDefaultCenturyYear = -1;
|
||||
@ -565,6 +552,9 @@ IslamicCalendar::initializeSystemDefaultCentury()
|
||||
}
|
||||
}
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IslamicCalendar)
|
||||
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
U_CFUNC UBool calendar_islamic_cleanup(void) {
|
||||
|
@ -372,7 +372,6 @@ class U_I18N_API IslamicCalendar : public Calendar {
|
||||
|
||||
private:
|
||||
IslamicCalendar(); // default constructor not implemented
|
||||
static const char fgClassID;
|
||||
|
||||
// Default century.
|
||||
protected:
|
||||
@ -450,35 +449,8 @@ class U_I18N_API IslamicCalendar : public Calendar {
|
||||
* before the current time.
|
||||
*/
|
||||
static void initializeSystemDefaultCentury(void);
|
||||
|
||||
public:
|
||||
// deprecates
|
||||
/**
|
||||
* (Overrides Calendar) Rolls up or down by the given amount in the specified field.
|
||||
* For more information, see the documentation for Calendar::roll().
|
||||
*
|
||||
* @param field The time field.
|
||||
* @param amount Indicates amount to roll.
|
||||
* @param status Output param set to success/failure code on exit. If any value
|
||||
* previously set in the time field is invalid, this will be set to
|
||||
* an error status.
|
||||
* @deprecated ICU 2.6 Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead. (here for subclass compat)
|
||||
*/
|
||||
virtual void roll(EDateFields field, int32_t amount, UErrorCode& status);
|
||||
};
|
||||
|
||||
inline UClassID
|
||||
IslamicCalendar::getStaticClassID(void)
|
||||
{ return (UClassID)&fgClassID; }
|
||||
|
||||
inline UClassID
|
||||
IslamicCalendar::getDynamicClassID(void) const
|
||||
{ return IslamicCalendar::getStaticClassID(); }
|
||||
|
||||
// INTERNAL - for cleanup
|
||||
// clean up the astronomical data & cache
|
||||
U_CFUNC UBool calendar_islamic_cleanup(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -573,7 +573,7 @@ public:
|
||||
* an error status.
|
||||
* @deprecated ICU 2.6. Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead.
|
||||
*/
|
||||
virtual void roll(EDateFields field, int32_t amount, UErrorCode& status) = 0;
|
||||
virtual void roll(EDateFields field, int32_t amount, UErrorCode& status);
|
||||
|
||||
/**
|
||||
* Time Field Rolling function. Rolls by the given amount on the given
|
||||
@ -2112,6 +2112,7 @@ Calendar::roll(EDateFields field, UBool up, UErrorCode& status)
|
||||
roll((UCalendarDateFields) field, up, status);
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user