ICU 70.1 70.1

tztrans.h
Go to the documentation of this file.
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/*
4*******************************************************************************
5* Copyright (C) 2007-2008, International Business Machines Corporation and *
6* others. All Rights Reserved. *
7*******************************************************************************
8*/
9#ifndef TZTRANS_H
10#define TZTRANS_H
11
17#include "unicode/utypes.h"
18
19#if U_SHOW_CPLUSPLUS_API
20
21#if !UCONFIG_NO_FORMATTING
22
23#include "unicode/uobject.h"
24
25U_NAMESPACE_BEGIN
26
27// Forward declaration
28 class TimeZoneRule;
29
35 class U_I18N_API TimeZoneTransition : public UObject {
36 public:
46 TimeZoneTransition(UDate time, const TimeZoneRule& from, const TimeZoneRule& to);
47
52 TimeZoneTransition();
53
59 TimeZoneTransition(const TimeZoneTransition& source);
60
65 ~TimeZoneTransition();
66
73 TimeZoneTransition* clone() const;
74
80 TimeZoneTransition& operator=(const TimeZoneTransition& right);
81
89 bool operator==(const TimeZoneTransition& that) const;
90
98 bool operator!=(const TimeZoneTransition& that) const;
99
105 UDate getTime(void) const;
106
112 void setTime(UDate time);
113
119 const TimeZoneRule* getFrom(void) const;
120
127 void setFrom(const TimeZoneRule& from);
128
135 void adoptFrom(TimeZoneRule* from);
136
143 void setTo(const TimeZoneRule& to);
144
151 void adoptTo(TimeZoneRule* to);
152
158 const TimeZoneRule* getTo(void) const;
159
160 private:
161 UDate fTime;
162 TimeZoneRule* fFrom;
163 TimeZoneRule* fTo;
164
165 public:
177 static UClassID U_EXPORT2 getStaticClassID(void);
178
190 virtual UClassID getDynamicClassID(void) const override;
191};
192
193U_NAMESPACE_END
194
195#endif /* #if !UCONFIG_NO_FORMATTING */
196
197#endif /* U_SHOW_CPLUSPLUS_API */
198
199#endif // TZTRANS_H
200
201//eof
icu::TimeZoneRule
TimeZoneRule is a class representing a rule for time zone.
Definition: tzrule.h:36
icu::TimeZoneTransition
TimeZoneTransition is a class representing a time zone transition.
Definition: tztrans.h:35
icu::TimeZoneTransition::TimeZoneTransition
TimeZoneTransition(UDate time, const TimeZoneRule &from, const TimeZoneRule &to)
Constructs a TimeZoneTransition with the time and the rules before/after the transition.
icu::TimeZoneTransition::TimeZoneTransition
TimeZoneTransition()
Constructs an empty TimeZoneTransition
icu::TimeZoneTransition::setTo
void setTo(const TimeZoneRule &to)
Sets the rule used after the transition.
icu::TimeZoneTransition::setFrom
void setFrom(const TimeZoneRule &from)
Sets the rule used before the transition.
icu::TimeZoneTransition::getFrom
const TimeZoneRule * getFrom(void) const
Returns the rule used before the transition.
icu::TimeZoneTransition::TimeZoneTransition
TimeZoneTransition(const TimeZoneTransition &source)
Copy constructor.
icu::TimeZoneTransition::getTime
UDate getTime(void) const
Returns the time of transition in milliseconds.
icu::TimeZoneTransition::adoptTo
void adoptTo(TimeZoneRule *to)
Adopts the rule used after the transition.
icu::TimeZoneTransition::getDynamicClassID
virtual UClassID getDynamicClassID(void) const override
Returns a unique class ID POLYMORPHICALLY.
icu::TimeZoneTransition::adoptFrom
void adoptFrom(TimeZoneRule *from)
Adopts the rule used before the transition.
icu::TimeZoneTransition::setTime
void setTime(UDate time)
Sets the time of transition in milliseconds.
icu::TimeZoneTransition::operator==
bool operator==(const TimeZoneTransition &that) const
Return true if the given TimeZoneTransition objects are semantically equal.
icu::TimeZoneTransition::getTo
const TimeZoneRule * getTo(void) const
Returns the rule used after the transition.
icu::TimeZoneTransition::operator=
TimeZoneTransition & operator=(const TimeZoneTransition &right)
Assignment operator.
icu::TimeZoneTransition::~TimeZoneTransition
~TimeZoneTransition()
Destructor.
icu::TimeZoneTransition::clone
TimeZoneTransition * clone() const
Clone this TimeZoneTransition object polymorphically.
icu::TimeZoneTransition::operator!=
bool operator!=(const TimeZoneTransition &that) const
Return true if the given TimeZoneTransition objects are semantically unequal.
icu::TimeZoneTransition::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
uobject.h
C++ API: Common ICU base class UObject.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition: utypes.h:301
UDate
double UDate
Date and Time data type.
Definition: utypes.h:203