Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * Copyright (C) 2007-2013, International Business Machines Corporation and |
michael@0 | 4 | * others. All Rights Reserved. |
michael@0 | 5 | ******************************************************************************* |
michael@0 | 6 | */ |
michael@0 | 7 | #ifndef VTZONE_H |
michael@0 | 8 | #define VTZONE_H |
michael@0 | 9 | |
michael@0 | 10 | #include "unicode/utypes.h" |
michael@0 | 11 | |
michael@0 | 12 | /** |
michael@0 | 13 | * \file |
michael@0 | 14 | * \brief C++ API: RFC2445 VTIMEZONE support |
michael@0 | 15 | */ |
michael@0 | 16 | |
michael@0 | 17 | #if !UCONFIG_NO_FORMATTING |
michael@0 | 18 | |
michael@0 | 19 | #include "unicode/basictz.h" |
michael@0 | 20 | |
michael@0 | 21 | U_NAMESPACE_BEGIN |
michael@0 | 22 | |
michael@0 | 23 | class VTZWriter; |
michael@0 | 24 | class VTZReader; |
michael@0 | 25 | class UVector; |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * <code>VTimeZone</code> is a class implementing RFC2445 VTIMEZONE. You can create a |
michael@0 | 29 | * <code>VTimeZone</code> instance from a time zone ID supported by <code>TimeZone</code>. |
michael@0 | 30 | * With the <code>VTimeZone</code> instance created from the ID, you can write out the rule |
michael@0 | 31 | * in RFC2445 VTIMEZONE format. Also, you can create a <code>VTimeZone</code> instance |
michael@0 | 32 | * from RFC2445 VTIMEZONE data stream, which allows you to calculate time |
michael@0 | 33 | * zone offset by the rules defined by the data. Or, you can create a |
michael@0 | 34 | * <code>VTimeZone</code> from any other ICU <code>BasicTimeZone</code>. |
michael@0 | 35 | * <br><br> |
michael@0 | 36 | * Note: The consumer of this class reading or writing VTIMEZONE data is responsible to |
michael@0 | 37 | * decode or encode Non-ASCII text. Methods reading/writing VTIMEZONE data in this class |
michael@0 | 38 | * do nothing with MIME encoding. |
michael@0 | 39 | * @stable ICU 3.8 |
michael@0 | 40 | */ |
michael@0 | 41 | class U_I18N_API VTimeZone : public BasicTimeZone { |
michael@0 | 42 | public: |
michael@0 | 43 | /** |
michael@0 | 44 | * Copy constructor. |
michael@0 | 45 | * @param source The <code>VTimeZone</code> object to be copied. |
michael@0 | 46 | * @stable ICU 3.8 |
michael@0 | 47 | */ |
michael@0 | 48 | VTimeZone(const VTimeZone& source); |
michael@0 | 49 | |
michael@0 | 50 | /** |
michael@0 | 51 | * Destructor. |
michael@0 | 52 | * @stable ICU 3.8 |
michael@0 | 53 | */ |
michael@0 | 54 | virtual ~VTimeZone(); |
michael@0 | 55 | |
michael@0 | 56 | /** |
michael@0 | 57 | * Assignment operator. |
michael@0 | 58 | * @param right The object to be copied. |
michael@0 | 59 | * @stable ICU 3.8 |
michael@0 | 60 | */ |
michael@0 | 61 | VTimeZone& operator=(const VTimeZone& right); |
michael@0 | 62 | |
michael@0 | 63 | /** |
michael@0 | 64 | * Return true if the given <code>TimeZone</code> objects are |
michael@0 | 65 | * semantically equal. Objects of different subclasses are considered unequal. |
michael@0 | 66 | * @param that The object to be compared with. |
michael@0 | 67 | * @return true if the given <code>TimeZone</code> objects are |
michael@0 | 68 | *semantically equal. |
michael@0 | 69 | * @stable ICU 3.8 |
michael@0 | 70 | */ |
michael@0 | 71 | virtual UBool operator==(const TimeZone& that) const; |
michael@0 | 72 | |
michael@0 | 73 | /** |
michael@0 | 74 | * Return true if the given <code>TimeZone</code> objects are |
michael@0 | 75 | * semantically unequal. Objects of different subclasses are considered unequal. |
michael@0 | 76 | * @param that The object to be compared with. |
michael@0 | 77 | * @return true if the given <code>TimeZone</code> objects are |
michael@0 | 78 | * semantically unequal. |
michael@0 | 79 | * @stable ICU 3.8 |
michael@0 | 80 | */ |
michael@0 | 81 | virtual UBool operator!=(const TimeZone& that) const; |
michael@0 | 82 | |
michael@0 | 83 | /** |
michael@0 | 84 | * Create a <code>VTimeZone</code> instance by the time zone ID. |
michael@0 | 85 | * @param ID The time zone ID, such as America/New_York |
michael@0 | 86 | * @return A <code>VTimeZone</code> object initialized by the time zone ID, |
michael@0 | 87 | * or NULL when the ID is unknown. |
michael@0 | 88 | * @stable ICU 3.8 |
michael@0 | 89 | */ |
michael@0 | 90 | static VTimeZone* createVTimeZoneByID(const UnicodeString& ID); |
michael@0 | 91 | |
michael@0 | 92 | /** |
michael@0 | 93 | * Create a <code>VTimeZone</code> instance using a basic time zone. |
michael@0 | 94 | * @param basicTZ The basic time zone instance |
michael@0 | 95 | * @param status Output param to filled in with a success or an error. |
michael@0 | 96 | * @return A <code>VTimeZone</code> object initialized by the basic time zone. |
michael@0 | 97 | * @stable ICU 4.6 |
michael@0 | 98 | */ |
michael@0 | 99 | static VTimeZone* createVTimeZoneFromBasicTimeZone(const BasicTimeZone& basicTZ, |
michael@0 | 100 | UErrorCode &status); |
michael@0 | 101 | |
michael@0 | 102 | /** |
michael@0 | 103 | * Create a <code>VTimeZone</code> instance by RFC2445 VTIMEZONE data |
michael@0 | 104 | * |
michael@0 | 105 | * @param vtzdata The string including VTIMEZONE data block |
michael@0 | 106 | * @param status Output param to filled in with a success or an error. |
michael@0 | 107 | * @return A <code>VTimeZone</code> initialized by the VTIMEZONE data or |
michael@0 | 108 | * NULL if failed to load the rule from the VTIMEZONE data. |
michael@0 | 109 | * @stable ICU 3.8 |
michael@0 | 110 | */ |
michael@0 | 111 | static VTimeZone* createVTimeZone(const UnicodeString& vtzdata, UErrorCode& status); |
michael@0 | 112 | |
michael@0 | 113 | /** |
michael@0 | 114 | * Gets the RFC2445 TZURL property value. When a <code>VTimeZone</code> instance was |
michael@0 | 115 | * created from VTIMEZONE data, the initial value is set by the TZURL property value |
michael@0 | 116 | * in the data. Otherwise, the initial value is not set. |
michael@0 | 117 | * @param url Receives the RFC2445 TZURL property value. |
michael@0 | 118 | * @return TRUE if TZURL attribute is available and value is set. |
michael@0 | 119 | * @stable ICU 3.8 |
michael@0 | 120 | */ |
michael@0 | 121 | UBool getTZURL(UnicodeString& url) const; |
michael@0 | 122 | |
michael@0 | 123 | /** |
michael@0 | 124 | * Sets the RFC2445 TZURL property value. |
michael@0 | 125 | * @param url The TZURL property value. |
michael@0 | 126 | * @stable ICU 3.8 |
michael@0 | 127 | */ |
michael@0 | 128 | void setTZURL(const UnicodeString& url); |
michael@0 | 129 | |
michael@0 | 130 | /** |
michael@0 | 131 | * Gets the RFC2445 LAST-MODIFIED property value. When a <code>VTimeZone</code> instance |
michael@0 | 132 | * was created from VTIMEZONE data, the initial value is set by the LAST-MODIFIED property |
michael@0 | 133 | * value in the data. Otherwise, the initial value is not set. |
michael@0 | 134 | * @param lastModified Receives the last modified date. |
michael@0 | 135 | * @return TRUE if lastModified attribute is available and value is set. |
michael@0 | 136 | * @stable ICU 3.8 |
michael@0 | 137 | */ |
michael@0 | 138 | UBool getLastModified(UDate& lastModified) const; |
michael@0 | 139 | |
michael@0 | 140 | /** |
michael@0 | 141 | * Sets the RFC2445 LAST-MODIFIED property value. |
michael@0 | 142 | * @param lastModified The LAST-MODIFIED date. |
michael@0 | 143 | * @stable ICU 3.8 |
michael@0 | 144 | */ |
michael@0 | 145 | void setLastModified(UDate lastModified); |
michael@0 | 146 | |
michael@0 | 147 | /** |
michael@0 | 148 | * Writes RFC2445 VTIMEZONE data for this time zone |
michael@0 | 149 | * @param result Output param to filled in with the VTIMEZONE data. |
michael@0 | 150 | * @param status Output param to filled in with a success or an error. |
michael@0 | 151 | * @stable ICU 3.8 |
michael@0 | 152 | */ |
michael@0 | 153 | void write(UnicodeString& result, UErrorCode& status) const; |
michael@0 | 154 | |
michael@0 | 155 | /** |
michael@0 | 156 | * Writes RFC2445 VTIMEZONE data for this time zone applicalbe |
michael@0 | 157 | * for dates after the specified start time. |
michael@0 | 158 | * @param start The start date. |
michael@0 | 159 | * @param result Output param to filled in with the VTIMEZONE data. |
michael@0 | 160 | * @param status Output param to filled in with a success or an error. |
michael@0 | 161 | * @stable ICU 3.8 |
michael@0 | 162 | */ |
michael@0 | 163 | void write(UDate start, UnicodeString& result, UErrorCode& status) const; |
michael@0 | 164 | |
michael@0 | 165 | /** |
michael@0 | 166 | * Writes RFC2445 VTIMEZONE data applicalbe for the specified date. |
michael@0 | 167 | * Some common iCalendar implementations can only handle a single time |
michael@0 | 168 | * zone property or a pair of standard and daylight time properties using |
michael@0 | 169 | * BYDAY rule with day of week (such as BYDAY=1SUN). This method produce |
michael@0 | 170 | * the VTIMEZONE data which can be handled these implementations. The rules |
michael@0 | 171 | * produced by this method can be used only for calculating time zone offset |
michael@0 | 172 | * around the specified date. |
michael@0 | 173 | * @param time The date used for rule extraction. |
michael@0 | 174 | * @param result Output param to filled in with the VTIMEZONE data. |
michael@0 | 175 | * @param status Output param to filled in with a success or an error. |
michael@0 | 176 | * @stable ICU 3.8 |
michael@0 | 177 | */ |
michael@0 | 178 | void writeSimple(UDate time, UnicodeString& result, UErrorCode& status) const; |
michael@0 | 179 | |
michael@0 | 180 | /** |
michael@0 | 181 | * Clones TimeZone objects polymorphically. Clients are responsible for deleting |
michael@0 | 182 | * the TimeZone object cloned. |
michael@0 | 183 | * @return A new copy of this TimeZone object. |
michael@0 | 184 | * @stable ICU 3.8 |
michael@0 | 185 | */ |
michael@0 | 186 | virtual TimeZone* clone(void) const; |
michael@0 | 187 | |
michael@0 | 188 | /** |
michael@0 | 189 | * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add |
michael@0 | 190 | * to GMT to get local time in this time zone, taking daylight savings time into |
michael@0 | 191 | * account) as of a particular reference date. The reference date is used to determine |
michael@0 | 192 | * whether daylight savings time is in effect and needs to be figured into the offset |
michael@0 | 193 | * that is returned (in other words, what is the adjusted GMT offset in this time zone |
michael@0 | 194 | * at this particular date and time?). For the time zones produced by createTimeZone(), |
michael@0 | 195 | * the reference data is specified according to the Gregorian calendar, and the date |
michael@0 | 196 | * and time fields are local standard time. |
michael@0 | 197 | * |
michael@0 | 198 | * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload, |
michael@0 | 199 | * which returns both the raw and the DST offset for a given time. This method |
michael@0 | 200 | * is retained only for backward compatibility. |
michael@0 | 201 | * |
michael@0 | 202 | * @param era The reference date's era |
michael@0 | 203 | * @param year The reference date's year |
michael@0 | 204 | * @param month The reference date's month (0-based; 0 is January) |
michael@0 | 205 | * @param day The reference date's day-in-month (1-based) |
michael@0 | 206 | * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday) |
michael@0 | 207 | * @param millis The reference date's milliseconds in day, local standard time |
michael@0 | 208 | * @param status Output param to filled in with a success or an error. |
michael@0 | 209 | * @return The offset in milliseconds to add to GMT to get local time. |
michael@0 | 210 | * @stable ICU 3.8 |
michael@0 | 211 | */ |
michael@0 | 212 | virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, |
michael@0 | 213 | uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const; |
michael@0 | 214 | |
michael@0 | 215 | /** |
michael@0 | 216 | * Gets the time zone offset, for current date, modified in case of |
michael@0 | 217 | * daylight savings. This is the offset to add *to* UTC to get local time. |
michael@0 | 218 | * |
michael@0 | 219 | * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload, |
michael@0 | 220 | * which returns both the raw and the DST offset for a given time. This method |
michael@0 | 221 | * is retained only for backward compatibility. |
michael@0 | 222 | * |
michael@0 | 223 | * @param era The reference date's era |
michael@0 | 224 | * @param year The reference date's year |
michael@0 | 225 | * @param month The reference date's month (0-based; 0 is January) |
michael@0 | 226 | * @param day The reference date's day-in-month (1-based) |
michael@0 | 227 | * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday) |
michael@0 | 228 | * @param millis The reference date's milliseconds in day, local standard time |
michael@0 | 229 | * @param monthLength The length of the given month in days. |
michael@0 | 230 | * @param status Output param to filled in with a success or an error. |
michael@0 | 231 | * @return The offset in milliseconds to add to GMT to get local time. |
michael@0 | 232 | * @stable ICU 3.8 |
michael@0 | 233 | */ |
michael@0 | 234 | virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, |
michael@0 | 235 | uint8_t dayOfWeek, int32_t millis, |
michael@0 | 236 | int32_t monthLength, UErrorCode& status) const; |
michael@0 | 237 | |
michael@0 | 238 | /** |
michael@0 | 239 | * Returns the time zone raw and GMT offset for the given moment |
michael@0 | 240 | * in time. Upon return, local-millis = GMT-millis + rawOffset + |
michael@0 | 241 | * dstOffset. All computations are performed in the proleptic |
michael@0 | 242 | * Gregorian calendar. The default implementation in the TimeZone |
michael@0 | 243 | * class delegates to the 8-argument getOffset(). |
michael@0 | 244 | * |
michael@0 | 245 | * @param date moment in time for which to return offsets, in |
michael@0 | 246 | * units of milliseconds from January 1, 1970 0:00 GMT, either GMT |
michael@0 | 247 | * time or local wall time, depending on `local'. |
michael@0 | 248 | * @param local if true, `date' is local wall time; otherwise it |
michael@0 | 249 | * is in GMT time. |
michael@0 | 250 | * @param rawOffset output parameter to receive the raw offset, that |
michael@0 | 251 | * is, the offset not including DST adjustments |
michael@0 | 252 | * @param dstOffset output parameter to receive the DST offset, |
michael@0 | 253 | * that is, the offset to be added to `rawOffset' to obtain the |
michael@0 | 254 | * total offset between local and GMT time. If DST is not in |
michael@0 | 255 | * effect, this value is zero; otherwise it is a positive value, |
michael@0 | 256 | * typically one hour. |
michael@0 | 257 | * @param ec input-output error code |
michael@0 | 258 | * @stable ICU 3.8 |
michael@0 | 259 | */ |
michael@0 | 260 | virtual void getOffset(UDate date, UBool local, int32_t& rawOffset, |
michael@0 | 261 | int32_t& dstOffset, UErrorCode& ec) const; |
michael@0 | 262 | |
michael@0 | 263 | /** |
michael@0 | 264 | * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add |
michael@0 | 265 | * to GMT to get local time, before taking daylight savings time into account). |
michael@0 | 266 | * |
michael@0 | 267 | * @param offsetMillis The new raw GMT offset for this time zone. |
michael@0 | 268 | * @stable ICU 3.8 |
michael@0 | 269 | */ |
michael@0 | 270 | virtual void setRawOffset(int32_t offsetMillis); |
michael@0 | 271 | |
michael@0 | 272 | /** |
michael@0 | 273 | * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add |
michael@0 | 274 | * to GMT to get local time, before taking daylight savings time into account). |
michael@0 | 275 | * |
michael@0 | 276 | * @return The TimeZone's raw GMT offset. |
michael@0 | 277 | * @stable ICU 3.8 |
michael@0 | 278 | */ |
michael@0 | 279 | virtual int32_t getRawOffset(void) const; |
michael@0 | 280 | |
michael@0 | 281 | /** |
michael@0 | 282 | * Queries if this time zone uses daylight savings time. |
michael@0 | 283 | * @return true if this time zone uses daylight savings time, |
michael@0 | 284 | * false, otherwise. |
michael@0 | 285 | * @stable ICU 3.8 |
michael@0 | 286 | */ |
michael@0 | 287 | virtual UBool useDaylightTime(void) const; |
michael@0 | 288 | |
michael@0 | 289 | /** |
michael@0 | 290 | * Queries if the given date is in daylight savings time in |
michael@0 | 291 | * this time zone. |
michael@0 | 292 | * This method is wasteful since it creates a new GregorianCalendar and |
michael@0 | 293 | * deletes it each time it is called. This is a deprecated method |
michael@0 | 294 | * and provided only for Java compatibility. |
michael@0 | 295 | * |
michael@0 | 296 | * @param date the given UDate. |
michael@0 | 297 | * @param status Output param filled in with success/error code. |
michael@0 | 298 | * @return true if the given date is in daylight savings time, |
michael@0 | 299 | * false, otherwise. |
michael@0 | 300 | * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead. |
michael@0 | 301 | */ |
michael@0 | 302 | virtual UBool inDaylightTime(UDate date, UErrorCode& status) const; |
michael@0 | 303 | |
michael@0 | 304 | /** |
michael@0 | 305 | * Returns true if this zone has the same rule and offset as another zone. |
michael@0 | 306 | * That is, if this zone differs only in ID, if at all. |
michael@0 | 307 | * @param other the <code>TimeZone</code> object to be compared with |
michael@0 | 308 | * @return true if the given zone is the same as this one, |
michael@0 | 309 | * with the possible exception of the ID |
michael@0 | 310 | * @stable ICU 3.8 |
michael@0 | 311 | */ |
michael@0 | 312 | virtual UBool hasSameRules(const TimeZone& other) const; |
michael@0 | 313 | |
michael@0 | 314 | /** |
michael@0 | 315 | * Gets the first time zone transition after the base time. |
michael@0 | 316 | * @param base The base time. |
michael@0 | 317 | * @param inclusive Whether the base time is inclusive or not. |
michael@0 | 318 | * @param result Receives the first transition after the base time. |
michael@0 | 319 | * @return TRUE if the transition is found. |
michael@0 | 320 | * @stable ICU 3.8 |
michael@0 | 321 | */ |
michael@0 | 322 | virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; |
michael@0 | 323 | |
michael@0 | 324 | /** |
michael@0 | 325 | * Gets the most recent time zone transition before the base time. |
michael@0 | 326 | * @param base The base time. |
michael@0 | 327 | * @param inclusive Whether the base time is inclusive or not. |
michael@0 | 328 | * @param result Receives the most recent transition before the base time. |
michael@0 | 329 | * @return TRUE if the transition is found. |
michael@0 | 330 | * @stable ICU 3.8 |
michael@0 | 331 | */ |
michael@0 | 332 | virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; |
michael@0 | 333 | |
michael@0 | 334 | /** |
michael@0 | 335 | * Returns the number of <code>TimeZoneRule</code>s which represents time transitions, |
michael@0 | 336 | * for this time zone, that is, all <code>TimeZoneRule</code>s for this time zone except |
michael@0 | 337 | * <code>InitialTimeZoneRule</code>. The return value range is 0 or any positive value. |
michael@0 | 338 | * @param status Receives error status code. |
michael@0 | 339 | * @return The number of <code>TimeZoneRule</code>s representing time transitions. |
michael@0 | 340 | * @stable ICU 3.8 |
michael@0 | 341 | */ |
michael@0 | 342 | virtual int32_t countTransitionRules(UErrorCode& status) const; |
michael@0 | 343 | |
michael@0 | 344 | /** |
michael@0 | 345 | * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZoneRule</code> |
michael@0 | 346 | * which represent time transitions for this time zone. On successful return, |
michael@0 | 347 | * the argument initial points to non-NULL <code>InitialTimeZoneRule</code> and |
michael@0 | 348 | * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</code> |
michael@0 | 349 | * instances up to the size specified by trscount. The results are referencing the |
michael@0 | 350 | * rule instance held by this time zone instance. Therefore, after this time zone |
michael@0 | 351 | * is destructed, they are no longer available. |
michael@0 | 352 | * @param initial Receives the initial timezone rule |
michael@0 | 353 | * @param trsrules Receives the timezone transition rules |
michael@0 | 354 | * @param trscount On input, specify the size of the array 'transitions' receiving |
michael@0 | 355 | * the timezone transition rules. On output, actual number of |
michael@0 | 356 | * rules filled in the array will be set. |
michael@0 | 357 | * @param status Receives error status code. |
michael@0 | 358 | * @stable ICU 3.8 |
michael@0 | 359 | */ |
michael@0 | 360 | virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, |
michael@0 | 361 | const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const; |
michael@0 | 362 | |
michael@0 | 363 | private: |
michael@0 | 364 | enum { DEFAULT_VTIMEZONE_LINES = 100 }; |
michael@0 | 365 | |
michael@0 | 366 | /** |
michael@0 | 367 | * Default constructor. |
michael@0 | 368 | */ |
michael@0 | 369 | VTimeZone(); |
michael@0 | 370 | static VTimeZone* createVTimeZone(VTZReader* reader); |
michael@0 | 371 | void write(VTZWriter& writer, UErrorCode& status) const; |
michael@0 | 372 | void write(UDate start, VTZWriter& writer, UErrorCode& status) const; |
michael@0 | 373 | void writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) const; |
michael@0 | 374 | void load(VTZReader& reader, UErrorCode& status); |
michael@0 | 375 | void parse(UErrorCode& status); |
michael@0 | 376 | |
michael@0 | 377 | void writeZone(VTZWriter& w, BasicTimeZone& basictz, UVector* customProps, |
michael@0 | 378 | UErrorCode& status) const; |
michael@0 | 379 | |
michael@0 | 380 | void writeHeaders(VTZWriter& w, UErrorCode& status) const; |
michael@0 | 381 | void writeFooter(VTZWriter& writer, UErrorCode& status) const; |
michael@0 | 382 | |
michael@0 | 383 | void writeZonePropsByTime(VTZWriter& writer, UBool isDst, const UnicodeString& zonename, |
michael@0 | 384 | int32_t fromOffset, int32_t toOffset, UDate time, UBool withRDATE, |
michael@0 | 385 | UErrorCode& status) const; |
michael@0 | 386 | void writeZonePropsByDOM(VTZWriter& writer, UBool isDst, const UnicodeString& zonename, |
michael@0 | 387 | int32_t fromOffset, int32_t toOffset, |
michael@0 | 388 | int32_t month, int32_t dayOfMonth, UDate startTime, UDate untilTime, |
michael@0 | 389 | UErrorCode& status) const; |
michael@0 | 390 | void writeZonePropsByDOW(VTZWriter& writer, UBool isDst, const UnicodeString& zonename, |
michael@0 | 391 | int32_t fromOffset, int32_t toOffset, |
michael@0 | 392 | int32_t month, int32_t weekInMonth, int32_t dayOfWeek, |
michael@0 | 393 | UDate startTime, UDate untilTime, UErrorCode& status) const; |
michael@0 | 394 | void writeZonePropsByDOW_GEQ_DOM(VTZWriter& writer, UBool isDst, const UnicodeString& zonename, |
michael@0 | 395 | int32_t fromOffset, int32_t toOffset, |
michael@0 | 396 | int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, |
michael@0 | 397 | UDate startTime, UDate untilTime, UErrorCode& status) const; |
michael@0 | 398 | void writeZonePropsByDOW_GEQ_DOM_sub(VTZWriter& writer, int32_t month, int32_t dayOfMonth, |
michael@0 | 399 | int32_t dayOfWeek, int32_t numDays, |
michael@0 | 400 | UDate untilTime, int32_t fromOffset, UErrorCode& status) const; |
michael@0 | 401 | void writeZonePropsByDOW_LEQ_DOM(VTZWriter& writer, UBool isDst, const UnicodeString& zonename, |
michael@0 | 402 | int32_t fromOffset, int32_t toOffset, |
michael@0 | 403 | int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, |
michael@0 | 404 | UDate startTime, UDate untilTime, UErrorCode& status) const; |
michael@0 | 405 | void writeFinalRule(VTZWriter& writer, UBool isDst, const AnnualTimeZoneRule* rule, |
michael@0 | 406 | int32_t fromRawOffset, int32_t fromDSTSavings, |
michael@0 | 407 | UDate startTime, UErrorCode& status) const; |
michael@0 | 408 | |
michael@0 | 409 | void beginZoneProps(VTZWriter& writer, UBool isDst, const UnicodeString& zonename, |
michael@0 | 410 | int32_t fromOffset, int32_t toOffset, UDate startTime, UErrorCode& status) const; |
michael@0 | 411 | void endZoneProps(VTZWriter& writer, UBool isDst, UErrorCode& status) const; |
michael@0 | 412 | void beginRRULE(VTZWriter& writer, int32_t month, UErrorCode& status) const; |
michael@0 | 413 | void appendUNTIL(VTZWriter& writer, const UnicodeString& until, UErrorCode& status) const; |
michael@0 | 414 | |
michael@0 | 415 | BasicTimeZone *tz; |
michael@0 | 416 | UVector *vtzlines; |
michael@0 | 417 | UnicodeString tzurl; |
michael@0 | 418 | UDate lastmod; |
michael@0 | 419 | UnicodeString olsonzid; |
michael@0 | 420 | UnicodeString icutzver; |
michael@0 | 421 | |
michael@0 | 422 | public: |
michael@0 | 423 | /** |
michael@0 | 424 | * Return the class ID for this class. This is useful only for comparing to |
michael@0 | 425 | * a return value from getDynamicClassID(). For example: |
michael@0 | 426 | * <pre> |
michael@0 | 427 | * . Base* polymorphic_pointer = createPolymorphicObject(); |
michael@0 | 428 | * . if (polymorphic_pointer->getDynamicClassID() == |
michael@0 | 429 | * . erived::getStaticClassID()) ... |
michael@0 | 430 | * </pre> |
michael@0 | 431 | * @return The class ID for all objects of this class. |
michael@0 | 432 | * @stable ICU 3.8 |
michael@0 | 433 | */ |
michael@0 | 434 | static UClassID U_EXPORT2 getStaticClassID(void); |
michael@0 | 435 | |
michael@0 | 436 | /** |
michael@0 | 437 | * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This |
michael@0 | 438 | * method is to implement a simple version of RTTI, since not all C++ |
michael@0 | 439 | * compilers support genuine RTTI. Polymorphic operator==() and clone() |
michael@0 | 440 | * methods call this method. |
michael@0 | 441 | * |
michael@0 | 442 | * @return The class ID for this object. All objects of a |
michael@0 | 443 | * given class have the same class ID. Objects of |
michael@0 | 444 | * other classes have different class IDs. |
michael@0 | 445 | * @stable ICU 3.8 |
michael@0 | 446 | */ |
michael@0 | 447 | virtual UClassID getDynamicClassID(void) const; |
michael@0 | 448 | }; |
michael@0 | 449 | |
michael@0 | 450 | U_NAMESPACE_END |
michael@0 | 451 | |
michael@0 | 452 | #endif /* #if !UCONFIG_NO_FORMATTING */ |
michael@0 | 453 | |
michael@0 | 454 | #endif // VTZONE_H |
michael@0 | 455 | //eof |