ICU 76.1 76.1
Loading...
Searching...
No Matches
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
28class TimeZoneRule;
29
36public:
47
53
60
66
74
81
90
99
105 UDate getTime() const;
106
113
119 const TimeZoneRule* getFrom() const;
120
128
136
143 void setTo(const TimeZoneRule& to);
144
152
158 const TimeZoneRule* getTo() const;
159
160private:
161 UDate fTime;
162 TimeZoneRule* fFrom;
163 TimeZoneRule* fTo;
164
165public:
178
190 virtual UClassID getDynamicClassID() const override;
191};
192
194
195#endif /* #if !UCONFIG_NO_FORMATTING */
196
197#endif /* U_SHOW_CPLUSPLUS_API */
198
199#endif // TZTRANS_H
200
201//eof
"Smart pointer" base class; do not use directly: use LocalPointer etc.
TimeZoneRule is a class representing a rule for time zone.
Definition tzrule.h:36
TimeZoneTransition is a class representing a time zone transition.
Definition tztrans.h:35
TimeZoneTransition(UDate time, const TimeZoneRule &from, const TimeZoneRule &to)
Constructs a TimeZoneTransition with the time and the rules before/after the transition.
virtual UClassID getDynamicClassID() const override
Returns a unique class ID POLYMORPHICALLY.
TimeZoneTransition()
Constructs an empty TimeZoneTransition
void setTo(const TimeZoneRule &to)
Sets the rule used after the transition.
void setFrom(const TimeZoneRule &from)
Sets the rule used before the transition.
TimeZoneTransition(const TimeZoneTransition &source)
Copy constructor.
static UClassID getStaticClassID()
Return the class ID for this class.
const TimeZoneRule * getTo() const
Returns the rule used after the transition.
void adoptTo(TimeZoneRule *to)
Adopts the rule used after the transition.
UDate getTime() const
Returns the time of transition in milliseconds.
void adoptFrom(TimeZoneRule *from)
Adopts the rule used before the transition.
void setTime(UDate time)
Sets the time of transition in milliseconds.
bool operator==(const TimeZoneTransition &that) const
Return true if the given TimeZoneTransition objects are semantically equal.
TimeZoneTransition & operator=(const TimeZoneTransition &right)
Assignment operator.
~TimeZoneTransition()
Destructor.
TimeZoneTransition * clone() const
Clone this TimeZoneTransition object polymorphically.
bool operator!=(const TimeZoneTransition &that) const
Return true if the given TimeZoneTransition objects are semantically unequal.
const TimeZoneRule * getFrom() const
Returns the rule used before the transition.
UObject is the common ICU "boilerplate" class.
Definition uobject.h:223
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
Basic definitions for ICU, for both C and C++ APIs.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:316
double UDate
Date and Time data type.
Definition utypes.h:218