| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * Copyright (C) 1997-2010, International Business Machines Corporation and | 3 * Copyright (C) 1997-2010, International Business Machines Corporation and |
| 4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
| 5 ******************************************************************************* | 5 ******************************************************************************* |
| 6 * | 6 * |
| 7 * File SIMPLETZ.H | 7 * File SIMPLETZ.H |
| 8 * | 8 * |
| 9 * Modification History: | 9 * Modification History: |
| 10 * | 10 * |
| 11 * Date Name Description | 11 * Date Name Description |
| 12 * 12/05/96 clhuang Creation. | 12 * 12/05/96 clhuang Creation. |
| 13 * 04/21/97 aliu Fixed miscellaneous bugs found by inspection and | 13 * 04/21/97 aliu Fixed miscellaneous bugs found by inspection and |
| 14 * testing. | 14 * testing. |
| 15 * 07/29/97 aliu Ported source bodies back from Java version with | 15 * 07/29/97 aliu Ported source bodies back from Java version with |
| 16 * numerous feature enhancements and bug fixes. | 16 * numerous feature enhancements and bug fixes. |
| 17 * 08/10/98 stephen JDK 1.2 sync. | 17 * 08/10/98 stephen JDK 1.2 sync. |
| 18 * 09/17/98 stephen Fixed getOffset() for last hour of year and DST | 18 * 09/17/98 stephen Fixed getOffset() for last hour of year and DST |
| 19 * 12/02/99 aliu Added TimeMode and constructor and setStart/EndRule | 19 * 12/02/99 aliu Added TimeMode and constructor and setStart/EndRule |
| 20 * methods that take TimeMode. Whitespace cleanup. | 20 * methods that take TimeMode. Whitespace cleanup. |
| 21 *******************************************************************************
* | 21 *******************************************************************************
* |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #include <typeinfo> // for 'typeid' to work | |
| 25 | 24 |
| 26 #include "unicode/utypes.h" | 25 #include "unicode/utypes.h" |
| 27 | 26 |
| 28 #if !UCONFIG_NO_FORMATTING | 27 #if !UCONFIG_NO_FORMATTING |
| 29 | 28 |
| 30 #include "unicode/simpletz.h" | 29 #include "unicode/simpletz.h" |
| 31 #include "unicode/gregocal.h" | 30 #include "unicode/gregocal.h" |
| 32 #include "unicode/smpdtfmt.h" | 31 #include "unicode/smpdtfmt.h" |
| 33 | 32 |
| 34 #include "gregoimp.h" | 33 #include "gregoimp.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 223 } |
| 225 return *this; | 224 return *this; |
| 226 } | 225 } |
| 227 | 226 |
| 228 // ------------------------------------- | 227 // ------------------------------------- |
| 229 | 228 |
| 230 UBool | 229 UBool |
| 231 SimpleTimeZone::operator==(const TimeZone& that) const | 230 SimpleTimeZone::operator==(const TimeZone& that) const |
| 232 { | 231 { |
| 233 return ((this == &that) || | 232 return ((this == &that) || |
| 234 (typeid(*this) == typeid(that) && | 233 (CR_TYPEID(*this) == CR_TYPEID(that) && |
| 235 TimeZone::operator==(that) && | 234 TimeZone::operator==(that) && |
| 236 hasSameRules(that))); | 235 hasSameRules(that))); |
| 237 } | 236 } |
| 238 | 237 |
| 239 // ------------------------------------- | 238 // ------------------------------------- |
| 240 | 239 |
| 241 // Called by TimeZone::createDefault() inside a Mutex - be careful. | 240 // Called by TimeZone::createDefault() inside a Mutex - be careful. |
| 242 TimeZone* | 241 TimeZone* |
| 243 SimpleTimeZone::clone() const | 242 SimpleTimeZone::clone() const |
| 244 { | 243 { |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 | 735 |
| 737 /** | 736 /** |
| 738 * Return true if this zone has the same rules and offset as another zone. | 737 * Return true if this zone has the same rules and offset as another zone. |
| 739 * @param other the TimeZone object to be compared with | 738 * @param other the TimeZone object to be compared with |
| 740 * @return true if the given zone has the same rules and offset as this one | 739 * @return true if the given zone has the same rules and offset as this one |
| 741 */ | 740 */ |
| 742 UBool | 741 UBool |
| 743 SimpleTimeZone::hasSameRules(const TimeZone& other) const | 742 SimpleTimeZone::hasSameRules(const TimeZone& other) const |
| 744 { | 743 { |
| 745 if (this == &other) return TRUE; | 744 if (this == &other) return TRUE; |
| 746 if (typeid(*this) != typeid(other)) return FALSE; | 745 if (CR_TYPEID(*this) != CR_TYPEID(other)) return FALSE; |
| 747 SimpleTimeZone *that = (SimpleTimeZone*)&other; | 746 SimpleTimeZone *that = (SimpleTimeZone*)&other; |
| 748 return rawOffset == that->rawOffset && | 747 return rawOffset == that->rawOffset && |
| 749 useDaylight == that->useDaylight && | 748 useDaylight == that->useDaylight && |
| 750 (!useDaylight | 749 (!useDaylight |
| 751 // Only check rules if using DST | 750 // Only check rules if using DST |
| 752 || (dstSavings == that->dstSavings && | 751 || (dstSavings == that->dstSavings && |
| 753 startMode == that->startMode && | 752 startMode == that->startMode && |
| 754 startMonth == that->startMonth && | 753 startMonth == that->startMonth && |
| 755 startDay == that->startDay && | 754 startDay == that->startDay && |
| 756 startDayOfWeek == that->startDayOfWeek && | 755 startDayOfWeek == that->startDayOfWeek && |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 } | 1211 } |
| 1213 trscount = cnt; | 1212 trscount = cnt; |
| 1214 } | 1213 } |
| 1215 | 1214 |
| 1216 | 1215 |
| 1217 U_NAMESPACE_END | 1216 U_NAMESPACE_END |
| 1218 | 1217 |
| 1219 #endif /* #if !UCONFIG_NO_FORMATTING */ | 1218 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| 1220 | 1219 |
| 1221 //eof | 1220 //eof |
| OLD | NEW |