ICU 50.1.2  50.1.2
basictz.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2007-2011, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 *******************************************************************************
6 */
7 #ifndef BASICTZ_H
8 #define BASICTZ_H
9 
15 #include "unicode/utypes.h"
16 
17 #if !UCONFIG_NO_FORMATTING
18 
19 #include "unicode/timezone.h"
20 #include "unicode/tzrule.h"
21 #include "unicode/tztrans.h"
22 
24 
25 // forward declarations
26 class UVector;
27 
35 public:
40  virtual ~BasicTimeZone();
41 
50  virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/ = 0;
51 
60  virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/ = 0;
61 
82  virtual UBool hasEquivalentTransitions(/*const*/ BasicTimeZone& tz, UDate start, UDate end,
83  UBool ignoreDstAmount, UErrorCode& ec) /*const*/;
84 
93  virtual int32_t countTransitionRules(UErrorCode& status) /*const*/ = 0;
94 
111  virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
112  const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) /*const*/ = 0;
113 
140  virtual void getSimpleRulesNear(UDate date, InitialTimeZoneRule*& initial,
141  AnnualTimeZoneRule*& std, AnnualTimeZoneRule*& dst, UErrorCode& status) /*const*/;
142 
143 
144 #ifndef U_HIDE_INTERNAL_API
145 
149  enum {
150  kStandard = 0x01,
151  kDaylight = 0x03,
152  kFormer = 0x04,
153  kLatter = 0x0C
154  };
155 #endif /* U_HIDE_INTERNAL_API */
156 
161  virtual void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt,
162  int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) /*const*/;
163 
164 protected:
165 
166 #ifndef U_HIDE_INTERNAL_API
167 
171  enum {
172  kStdDstMask = kDaylight,
173  kFormerLatterMask = kLatter
174  };
175 #endif /* U_HIDE_INTERNAL_API */
176 
181  BasicTimeZone();
182 
188  BasicTimeZone(const UnicodeString &id);
189 
195  BasicTimeZone(const BasicTimeZone& source);
196 
204  void getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial, UVector*& transitionRules,
205  UErrorCode& status) /*const*/;
206 };
207 
209 
210 #endif /* #if !UCONFIG_NO_FORMATTING */
211 
212 #endif // BASICTZ_H
213 
214 //eof
C++ API: TimeZone object.
double UDate
Date and Time data type.
Definition: utypes.h:201
TimeZone represents a time zone offset, and also figures out daylight savings.
Definition: timezone.h:129
C++ API: Time zone transition.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:358
TimeZoneRule is a class representing a rule for time zone.
Definition: tzrule.h:32
InitialTimeZoneRule represents a time zone rule representing a time zone effective from the beginning...
Definition: tzrule.h:198
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
TimeZoneTransition is a class representing a time zone transition.
Definition: tztrans.h:31
C++ API: Time zone rule classes.
BasicTimeZone is an abstract class extending TimeZone.
Definition: basictz.h:34
AnnualTimeZoneRule is a class used for representing a time zone rule which takes effect annually...
Definition: tzrule.h:376
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
Basic definitions for ICU, for both C and C++ APIs.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:246
int8_t UBool
The ICU boolean type.
Definition: umachine.h:200