ICU 71.1 71.1

basictz.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-2013, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 */
9 #ifndef BASICTZ_H
10 #define BASICTZ_H
11
17 #include "unicode/utypes.h"
18
19 #if U_SHOW_CPLUSPLUS_API
20
21 #if !UCONFIG_NO_FORMATTING
22
23 #include "unicode/timezone.h"
24 #include "unicode/tzrule.h"
25 #include "unicode/tztrans.h"
26
27 U_NAMESPACE_BEGIN
28
29 // forward declarations
30 class UVector;
31
38 class U_I18N_API BasicTimeZone: public TimeZone {
39 public:
44 virtual ~BasicTimeZone();
45
52 virtual BasicTimeZone* clone() const override = 0;
53
62 virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const = 0;
63
72 virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const = 0;
73
94 virtual UBool hasEquivalentTransitions(const BasicTimeZone& tz, UDate start, UDate end,
95 UBool ignoreDstAmount, UErrorCode& ec) const;
96
105 virtual int32_t countTransitionRules(UErrorCode& status) const = 0;
106
123 virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
124 const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const = 0;
125
152 virtual void getSimpleRulesNear(UDate date, InitialTimeZoneRule*& initial,
153 AnnualTimeZoneRule*& std, AnnualTimeZoneRule*& dst, UErrorCode& status) const;
154
159 virtual void getOffsetFromLocal(
160 UDate date, UTimeZoneLocalOption nonExistingTimeOpt,
161 UTimeZoneLocalOption duplicatedTimeOpt, int32_t& rawOffset,
162 int32_t& dstOffset, UErrorCode& status) const;
163
164
165 #ifndef U_HIDE_INTERNAL_API
166
170 enum {
171 kStandard = 0x01,
172 kDaylight = 0x03,
173 kFormer = 0x04, /* UCAL_TZ_LOCAL_FORMER */
174 kLatter = 0x0C /* UCAL_TZ_LOCAL_LATTER */
175 };
176
181 void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt,
182 int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const;
183 #endif /* U_HIDE_INTERNAL_API */
184
185 protected:
186
187 #ifndef U_HIDE_INTERNAL_API
188
192 enum {
193 kStdDstMask = kDaylight,
194 kFormerLatterMask = kLatter
195 };
196 #endif /* U_HIDE_INTERNAL_API */
197
202 BasicTimeZone();
203
209 BasicTimeZone(const UnicodeString &id);
210
216 BasicTimeZone(const BasicTimeZone& source);
217
222 BasicTimeZone& operator=(const BasicTimeZone&) = default;
223
234 void getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial, UVector*& transitionRules,
235 UErrorCode& status) const;
236 };
237
238 U_NAMESPACE_END
239
240 #endif /* #if !UCONFIG_NO_FORMATTING */
241
242 #endif /* U_SHOW_CPLUSPLUS_API */
243
244 #endif // BASICTZ_H
245
246 //eof
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_I18N_API
#define U_I18N_API
Definition: utypes.h:301
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
icu::BasicTimeZone
BasicTimeZone is an abstract class extending TimeZone.
Definition: basictz.h:38
icu::TimeZoneRule
TimeZoneRule is a class representing a rule for time zone.
Definition: tzrule.h:36
icu::TimeZone
TimeZone represents a time zone offset, and also figures out daylight savings.
Definition: timezone.h:133
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:295
timezone.h
C++ API: TimeZone object.
icu::AnnualTimeZoneRule
AnnualTimeZoneRule is a class used for representing a time zone rule which takes effect annually.
Definition: tzrule.h:380
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
tztrans.h
C++ API: Time zone transition.
icu::InitialTimeZoneRule
InitialTimeZoneRule represents a time zone rule representing a time zone effective from the beginning...
Definition: tzrule.h:202
icu::TimeZone::operator=
TimeZone & operator=(const TimeZone &right)
Default assignment operator.
icu::TimeZoneTransition
TimeZoneTransition is a class representing a time zone transition.
Definition: tztrans.h:35
UTimeZoneLocalOption
UTimeZoneLocalOption
Options used by ucal_getTimeZoneOffsetFromLocal and BasicTimeZone::getOffsetFromLocal() to specify ho...
Definition: ucal.h:1626
UDate
double UDate
Date and Time data type.
Definition: utypes.h:203
icu::TimeZone::clone
virtual TimeZone * clone() const =0
Clones TimeZone objects polymorphically.
tzrule.h
C++ API: Time zone rule classes.