diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-04-20 18:13:48 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-04-20 18:13:48 +0000 |
commit | e5786f530f9555469c01435f86039b06aa53feba (patch) | |
tree | c868e8d32282422d7d445b729db95c3fcdafb6d0 /Build/source/libs/icu/icu-xetex/i18n/tztrans.cpp | |
parent | ebaa1768b43c8606d923d2e861b5286b74207b3e (diff) |
new build system: build icu libs and xetex plus misc updates
git-svn-id: svn://tug.org/texlive/trunk@12759 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu/icu-xetex/i18n/tztrans.cpp')
-rw-r--r-- | Build/source/libs/icu/icu-xetex/i18n/tztrans.cpp | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/Build/source/libs/icu/icu-xetex/i18n/tztrans.cpp b/Build/source/libs/icu/icu-xetex/i18n/tztrans.cpp new file mode 100644 index 00000000000..32e6ff7ffb9 --- /dev/null +++ b/Build/source/libs/icu/icu-xetex/i18n/tztrans.cpp @@ -0,0 +1,144 @@ +/* +******************************************************************************* +* Copyright (C) 2007, International Business Machines Corporation and * +* others. All Rights Reserved. * +******************************************************************************* +*/ + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING + +#include "unicode/tzrule.h" +#include "unicode/tztrans.h" + +U_NAMESPACE_BEGIN + +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeZoneTransition) + +TimeZoneTransition::TimeZoneTransition(UDate time, const TimeZoneRule& from, const TimeZoneRule& to) +: UObject(), fTime(time), fFrom(from.clone()), fTo(to.clone()) { +} + +TimeZoneTransition::TimeZoneTransition() +: UObject(), fTime(0), fFrom(NULL), fTo(NULL) { +} + +TimeZoneTransition::TimeZoneTransition(const TimeZoneTransition& source) +: UObject(), fTime(source.fTime), fFrom(NULL), fTo(NULL) { + if (source.fFrom != NULL) { + fFrom = source.fFrom->clone(); + } + + if (source.fTo != NULL) { + fTo = source.fTo->clone(); + } +} + +TimeZoneTransition::~TimeZoneTransition() { + if (fFrom != NULL) { + delete fFrom; + } + if (fTo != NULL) { + delete fTo; + } +} + +TimeZoneTransition* +TimeZoneTransition::clone(void) const { + return new TimeZoneTransition(*this); +} + +TimeZoneTransition& +TimeZoneTransition::operator=(const TimeZoneTransition& right) { + if (this != &right) { + fTime = right.fTime; + setFrom(*right.fFrom); + setTo(*right.fTo); + } + return *this; +} + +UBool +TimeZoneTransition::operator==(const TimeZoneTransition& that) const { + if (this == &that) { + return TRUE; + } + if (getDynamicClassID() != that.getDynamicClassID()) { + return FALSE; + } + if (fTime != that.fTime) { + return FALSE; + } + if (fFrom == NULL && that.fFrom == NULL + || fFrom != NULL && that.fFrom != NULL && *fFrom == *(that.fFrom)) { + if (fTo == NULL && that.fTo == NULL + || fTo != NULL && that.fTo != NULL && *fTo == *(that.fTo)) { + return TRUE; + } + } + return FALSE; +} + +UBool +TimeZoneTransition::operator!=(const TimeZoneTransition& that) const { + return !operator==(that); +} + +void +TimeZoneTransition::setTime(UDate time) { + fTime = time; +} + +void +TimeZoneTransition::setFrom(const TimeZoneRule& from) { + if (fFrom != NULL) { + delete fFrom; + } + fFrom = from.clone(); +} + +void +TimeZoneTransition::adoptFrom(TimeZoneRule* from) { + if (fFrom != NULL) { + delete fFrom; + } + fFrom = from; +} + +void +TimeZoneTransition::setTo(const TimeZoneRule& to) { + if (fTo != NULL) { + delete fTo; + } + fTo = to.clone(); +} + +void +TimeZoneTransition::adoptTo(TimeZoneRule* to) { + if (fTo != NULL) { + delete fTo; + } + fTo = to; +} + +UDate +TimeZoneTransition::getTime(void) const { + return fTime; +} + +const TimeZoneRule* +TimeZoneTransition::getTo(void) const { + return fTo; +} + +const TimeZoneRule* +TimeZoneTransition::getFrom(void) const { + return fFrom; +} + +U_NAMESPACE_END + +#endif + +//eof |