+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
-* Copyright (C) 2007, International Business Machines Corporation and *
-* others. All Rights Reserved. *
+* Copyright (C) 2007-2012, International Business Machines Corporation and
+* others. All Rights Reserved.
*******************************************************************************
*/
+#include "utypeinfo.h" // for 'typeid' to work
+
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
UBool
TimeZoneRule::operator==(const TimeZoneRule& that) const {
return ((this == &that) ||
- (getDynamicClassID() == that.getDynamicClassID() &&
+ (typeid(*this) == typeid(that) &&
fName == that.fName &&
fRawOffset == that.fRawOffset &&
fDSTSavings == that.fDSTSavings));
UBool
TimeZoneRule::isEquivalentTo(const TimeZoneRule& other) const {
return ((this == &other) ||
- (getDynamicClassID() == other.getDynamicClassID() &&
+ (typeid(*this) == typeid(other) &&
fRawOffset == other.fRawOffset &&
fDSTSavings == other.fDSTSavings));
}
UBool
InitialTimeZoneRule::operator==(const TimeZoneRule& that) const {
return ((this == &that) ||
- (getDynamicClassID() == that.getDynamicClassID() &&
+ (typeid(*this) == typeid(that) &&
TimeZoneRule::operator==(that)));
}
if (this == &other) {
return TRUE;
}
- if (getDynamicClassID() != other.getDynamicClassID() ||
- TimeZoneRule::isEquivalentTo(other) == FALSE) {
+ if (typeid(*this) != typeid(other) || TimeZoneRule::isEquivalentTo(other) == FALSE) {
return FALSE;
}
return TRUE;
}
UBool
-InitialTimeZoneRule::getNextStart(const UDate /*base*/,
+InitialTimeZoneRule::getNextStart(UDate /*base*/,
int32_t /*prevRawOffset*/,
int32_t /*prevDSTSavings*/,
UBool /*inclusive*/,
}
UBool
-InitialTimeZoneRule::getPreviousStart(const UDate /*base*/,
+InitialTimeZoneRule::getPreviousStart(UDate /*base*/,
int32_t /*prevRawOffset*/,
int32_t /*prevDSTSavings*/,
UBool /*inclusive*/,
if (this == &that) {
return TRUE;
}
- if (getDynamicClassID() != that.getDynamicClassID()) {
+ if (typeid(*this) != typeid(that)) {
return FALSE;
}
AnnualTimeZoneRule *atzr = (AnnualTimeZoneRule*)&that;
if (this == &other) {
return TRUE;
}
- if (getDynamicClassID() != other.getDynamicClassID() ||
- TimeZoneRule::isEquivalentTo(other) == FALSE) {
+ if (typeid(*this) != typeid(other) || TimeZoneRule::isEquivalentTo(other) == FALSE) {
return FALSE;
}
AnnualTimeZoneRule* that = (AnnualTimeZoneRule*)&other;
}
UBool
-AnnualTimeZoneRule::getNextStart(const UDate base,
+AnnualTimeZoneRule::getNextStart(UDate base,
int32_t prevRawOffset,
int32_t prevDSTSavings,
UBool inclusive,
}
UBool
-AnnualTimeZoneRule::getPreviousStart(const UDate base,
+AnnualTimeZoneRule::getPreviousStart(UDate base,
int32_t prevRawOffset,
int32_t prevDSTSavings,
UBool inclusive,
if (this == &that) {
return TRUE;
}
- if (getDynamicClassID() != that.getDynamicClassID()
- || TimeZoneRule::operator==(that) == FALSE) {
+ if (typeid(*this) != typeid(that) || TimeZoneRule::operator==(that) == FALSE) {
return FALSE;
}
TimeArrayTimeZoneRule *tatzr = (TimeArrayTimeZoneRule*)&that;
if (this == &other) {
return TRUE;
}
- if (getDynamicClassID() != other.getDynamicClassID()
- || TimeZoneRule::isEquivalentTo(other) == FALSE) {
+ if (typeid(*this) != typeid(other) || TimeZoneRule::isEquivalentTo(other) == FALSE) {
return FALSE;
}
TimeArrayTimeZoneRule* that = (TimeArrayTimeZoneRule*)&other;
}
UBool
-TimeArrayTimeZoneRule::getNextStart(const UDate base,
+TimeArrayTimeZoneRule::getNextStart(UDate base,
int32_t prevRawOffset,
int32_t prevDSTSavings,
UBool inclusive,
}
UBool
-TimeArrayTimeZoneRule::getPreviousStart(const UDate base,
+TimeArrayTimeZoneRule::getPreviousStart(UDate base,
int32_t prevRawOffset,
int32_t prevDSTSavings,
UBool inclusive,