aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/icu/include/unicode/timezone.h
diff options
context:
space:
mode:
authorromankoshelev <romankoshelev@yandex-team.com>2023-08-09 20:07:20 +0300
committerromankoshelev <romankoshelev@yandex-team.com>2023-08-09 20:59:13 +0300
commitfd82fb12fb45e71a02c628e45b12c50c0dd0d308 (patch)
treef582b79f9002ab1d083e9acda600dfb3551c47b6 /contrib/libs/icu/include/unicode/timezone.h
parentbf862ddf5c6178e1bb5e4fb3f7c61015deebe284 (diff)
downloadydb-fd82fb12fb45e71a02c628e45b12c50c0dd0d308.tar.gz
Update ICU to 70.1
Diffstat (limited to 'contrib/libs/icu/include/unicode/timezone.h')
-rw-r--r--contrib/libs/icu/include/unicode/timezone.h102
1 files changed, 82 insertions, 20 deletions
diff --git a/contrib/libs/icu/include/unicode/timezone.h b/contrib/libs/icu/include/unicode/timezone.h
index 433e3b5c46..382ad97d5b 100644
--- a/contrib/libs/icu/include/unicode/timezone.h
+++ b/contrib/libs/icu/include/unicode/timezone.h
@@ -199,16 +199,29 @@ public:
const int32_t* rawOffset,
UErrorCode& ec);
+#ifndef U_HIDE_DEPRECATED_API
/**
* Returns an enumeration over all recognized time zone IDs. (i.e.,
* all strings that createTimeZone() accepts)
*
* @return an enumeration object, owned by the caller.
- * @stable ICU 2.4
+ * @deprecated ICU 70 Use createEnumeration(UErrorCode&) instead.
*/
static StringEnumeration* U_EXPORT2 createEnumeration();
+#endif // U_HIDE_DEPRECATED_API
/**
+ * Returns an enumeration over all recognized time zone IDs. (i.e.,
+ * all strings that createTimeZone() accepts)
+ *
+ * @param status Receives the status.
+ * @return an enumeration object, owned by the caller.
+ * @stable ICU 70
+ */
+ static StringEnumeration* U_EXPORT2 createEnumeration(UErrorCode& status);
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
* Returns an enumeration over time zone IDs with a given raw
* offset from GMT. There may be several times zones with the
* same GMT offset that differ in the way they handle daylight
@@ -223,21 +236,57 @@ public:
* @param rawOffset an offset from GMT in milliseconds, ignoring
* the effect of daylight savings time, if any
* @return an enumeration object, owned by the caller
- * @stable ICU 2.4
+ * @deprecated ICU 70 Use createEnumerationForRawOffset(int32_t,UErrorCode&) instead.
*/
static StringEnumeration* U_EXPORT2 createEnumeration(int32_t rawOffset);
+#endif // U_HIDE_DEPRECATED_API
+
+ /**
+ * Returns an enumeration over time zone IDs with a given raw
+ * offset from GMT. There may be several times zones with the
+ * same GMT offset that differ in the way they handle daylight
+ * savings time. For example, the state of Arizona doesn't
+ * observe daylight savings time. If you ask for the time zone
+ * IDs corresponding to GMT-7:00, you'll get back an enumeration
+ * over two time zone IDs: "America/Denver," which corresponds to
+ * Mountain Standard Time in the winter and Mountain Daylight Time
+ * in the summer, and "America/Phoenix", which corresponds to
+ * Mountain Standard Time year-round, even in the summer.
+ *
+ * @param rawOffset an offset from GMT in milliseconds, ignoring
+ * the effect of daylight savings time, if any
+ * @param status Receives the status.
+ * @return an enumeration object, owned by the caller
+ * @stable ICU 70
+ */
+ static StringEnumeration* U_EXPORT2 createEnumerationForRawOffset(int32_t rawOffset, UErrorCode& status);
+#ifndef U_HIDE_DEPRECATED_API
/**
* Returns an enumeration over time zone IDs associated with the
- * given country. Some zones are affiliated with no country
+ * given region. Some zones are affiliated with no region
* (e.g., "UTC"); these may also be retrieved, as a group.
*
- * @param country The ISO 3166 two-letter country code, or NULL to
- * retrieve zones not affiliated with any country.
+ * @param region The ISO 3166 two-letter country code, or NULL to
+ * retrieve zones not affiliated with any region.
* @return an enumeration object, owned by the caller
- * @stable ICU 2.4
+ * @deprecated ICU 70 Use createEnumerationForRegion(const char*,UErrorCode&) instead.
*/
- static StringEnumeration* U_EXPORT2 createEnumeration(const char* country);
+ static StringEnumeration* U_EXPORT2 createEnumeration(const char* region);
+#endif // U_HIDE_DEPRECATED_API
+
+ /**
+ * Returns an enumeration over time zone IDs associated with the
+ * given region. Some zones are affiliated with no region
+ * (e.g., "UTC"); these may also be retrieved, as a group.
+ *
+ * @param region The ISO 3166 two-letter country code, or NULL to
+ * retrieve zones not affiliated with any region.
+ * @param status Receives the status.
+ * @return an enumeration object, owned by the caller
+ * @stable ICU 70
+ */
+ static StringEnumeration* U_EXPORT2 createEnumerationForRegion(const char* region, UErrorCode& status);
/**
* Returns the number of IDs in the equivalency group that
@@ -317,6 +366,19 @@ public:
*/
static TimeZone* U_EXPORT2 createDefault(void);
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * If the locale contains the timezone keyword, creates a copy of that TimeZone.
+ * Otherwise, create the default timezone.
+ *
+ * @param locale a locale which may contains 'timezone' keyword/value.
+ * @return A TimeZone. Clients are responsible for deleting the time zone
+ * object returned.
+ * @internal
+ */
+ static TimeZone* U_EXPORT2 forLocaleOrDefault(const Locale& locale);
+#endif /* U_HIDE_INTERNAL_API */
+
/**
* Sets the default time zone (i.e., what's returned by createDefault()) to be the
* specified time zone. If NULL is specified for the time zone, the default time
@@ -392,7 +454,7 @@ public:
*
* <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supplemental/zone_tzid.html">
* Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get the latest changes,
- * please read the ICU user guide section <a href="http://userguide.icu-project.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data">
+ * please read the ICU user guide section <a href="https://unicode-org.github.io/icu/userguide/datetime/timezone#updating-the-time-zone-data">
* Updating the Time Zone Data</a>.
*
* @param id A system time zone ID.
@@ -420,7 +482,7 @@ public:
*
* <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supplemental/zone_tzid.html">
* Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get the latest changes,
- * please read the ICU user guide section <a href="http://userguide.icu-project.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data">
+ * please read the ICU user guide section <a href="https://unicode-org.github.io/icu/userguide/datetime/timezone#updating-the-time-zone-data">
* Updating the Time Zone Data</a>.
*
* @param winid A Windows time zone ID.
@@ -441,22 +503,22 @@ public:
* IDs, but subclasses are expected to also compare the fields they add.)
*
* @param that The TimeZone object to be compared with.
- * @return True if the given TimeZone is equal to this TimeZone; false
+ * @return true if the given TimeZone is equal to this TimeZone; false
* otherwise.
* @stable ICU 2.0
*/
- virtual UBool operator==(const TimeZone& that) const;
+ virtual bool operator==(const TimeZone& that) const;
/**
* Returns true if the two TimeZones are NOT equal; that is, if operator==() returns
* false.
*
* @param that The TimeZone object to be compared with.
- * @return True if the given TimeZone is not equal to this TimeZone; false
+ * @return true if the given TimeZone is not equal to this TimeZone; false
* otherwise.
* @stable ICU 2.0
*/
- UBool operator!=(const TimeZone& that) const {return !operator==(that);}
+ bool operator!=(const TimeZone& that) const {return !operator==(that);}
/**
* Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add
@@ -696,8 +758,8 @@ public:
* there are time zones that used daylight savings time in the
* past, but no longer used currently. For example, Asia/Tokyo has
* never used daylight savings time since 1951. Most clients would
- * expect that this method to return <code>FALSE</code> for such case.
- * The default implementation of this method returns <code>TRUE</code>
+ * expect that this method to return <code>false</code> for such case.
+ * The default implementation of this method returns <code>true</code>
* when the time zone uses daylight savings time in the current
* (Gregorian) calendar year.
* <p>In Java 7, <code>observesDaylightTime()</code> was added in
@@ -777,7 +839,7 @@ public:
* same class ID. Objects of other classes have different class IDs.
* @stable ICU 2.0
*/
- virtual UClassID getDynamicClassID(void) const = 0;
+ virtual UClassID getDynamicClassID(void) const override = 0;
/**
* Returns the amount of time to be added to local standard time
@@ -910,11 +972,11 @@ private:
* Parses the given custom time zone identifier
* @param id id A string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
* GMT[+-]hh.
- * @param sign Receves parsed sign, 1 for positive, -1 for negative.
+ * @param sign Receives parsed sign, 1 for positive, -1 for negative.
* @param hour Receives parsed hour field
* @param minute Receives parsed minute field
* @param second Receives parsed second field
- * @return Returns TRUE when the given custom id is valid.
+ * @return Returns true when the given custom id is valid.
*/
static UBool parseCustomID(const UnicodeString& id, int32_t& sign, int32_t& hour,
int32_t& minute, int32_t& second);
@@ -937,8 +999,8 @@ private:
* @param hour offset hours
* @param min offset minutes
* @param sec offset seconds
- * @param negative sign of the offset, TRUE for negative offset.
- * @param id Receves the format result (normalized custom ID)
+ * @param negative sign of the offset, true for negative offset.
+ * @param id Receives the format result (normalized custom ID)
* @return The reference to id
*/
static UnicodeString& formatCustomID(int32_t hour, int32_t min, int32_t sec,