Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: icu46/source/i18n/tztrans.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/i18n/tzrule.cpp ('k') | icu46/source/i18n/ucal.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/i18n/tztrans.cpp
===================================================================
--- icu46/source/i18n/tztrans.cpp (revision 0)
+++ icu46/source/i18n/tztrans.cpp (revision 0)
@@ -0,0 +1,146 @@
+/*
+*******************************************************************************
+* Copyright (C) 2007-2010, International Business Machines Corporation and
+* others. All Rights Reserved.
+*******************************************************************************
+*/
+
+#include <typeinfo> // for 'typeid' to work
+
+#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 (typeid(*this) != typeid(that)) {
+ 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
Property changes on: icu46/source/i18n/tztrans.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « icu46/source/i18n/tzrule.cpp ('k') | icu46/source/i18n/ucal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698