/**
* Constants for time zone display format style used by format/parse APIs
* in TimeZoneFormat.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
typedef enum UTimeZoneFormatStyle {
/**
* Generic location format, such as "United States Time (New York)", "Italy Time"
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_GENERIC_LOCATION,
/**
* Generic long non-location format, such as "Eastern Time".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_GENERIC_LONG,
/**
* Generic short non-location format, such as "ET".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_GENERIC_SHORT,
/**
* Specific long format, such as "Eastern Standard Time".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_SPECIFIC_LONG,
/**
* Specific short format, such as "EST", "PDT".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_SPECIFIC_SHORT,
/**
* RFC822 format, such as "-0500"
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_RFC822,
/**
* Localized GMT offset format, such as "GMT-05:00", "UTC+0100"
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_LOCALIZED_GMT,
/**
* ISO 8601 format (extended), such as "-05:00", "Z"(UTC)
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_STYLE_ISO8601
} UTimeZoneFormatStyle;
/**
* Constants for GMT offset pattern types.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
typedef enum UTimeZoneFormatGMTOffsetPatternType {
/**
* Positive offset with hour and minute fields
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_PAT_POSITIVE_HM,
/**
* Positive offset with hour, minute and second fields
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_PAT_POSITIVE_HMS,
/**
* Negative offset with hour and minute fields
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_PAT_NEGATIVE_HM,
/**
* Negative offset with hour, minute and second fields
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_PAT_NEGATIVE_HMS
} UTimeZoneFormatGMTOffsetPatternType;
/**
* Constants for time types used by TimeZoneFormat APIs for
* receiving time type (standard time, daylight time or unknown).
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
typedef enum UTimeZoneFormatTimeType {
/**
* Unknown
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_TIME_TYPE_UNKNOWN,
/**
* Standard time
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_TIME_TYPE_STANDARD,
/**
* Daylight saving time
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_TIME_TYPE_DAYLIGHT
} UTimeZoneFormatTimeType;
/**
* Constants for parse option flags, used for specifying optional parse behavior.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
typedef enum UTimeZoneFormatParseOption {
/**
* No option.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_PARSE_OPTION_NONE = 0x00,
/**
* When a time zone display name is not found within a set of display names
* used for the specified style, look for the name from display names used
* by other styles.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZFMT_PARSE_OPTION_ALL_STYLES = 0x01
} UTimeZoneFormatParseOption;
*
* @see SimpleDateFormat
* @see TimeZoneNames
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
class U_I18N_API TimeZoneFormat : public Format {
public:
/**
* Copy constructor.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
TimeZoneFormat(const TimeZoneFormat& other);
/**
* Destructor.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual ~TimeZoneFormat();
/**
* Assignment operator.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
TimeZoneFormat& operator=(const TimeZoneFormat& other);
* @param other The object to be compared with.
* @return Return TRUE if the given Format objects are semantically equal.
* Objects of different subclasses are considered unequal.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UBool operator==(const Format& other) const;
* Clone this object polymorphically. The caller is responsible
* for deleting the result when done.
* @return A copy of the object
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual Format* clone() const;
* @param status Recevies the status.
* @return An instance of <code>TimeZoneFormat</code> for the given locale,
* owned by the caller.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
static TimeZoneFormat* U_EXPORT2 createInstance(const Locale& locale, UErrorCode& status);
/**
* Returns the time zone display name data used by this instance.
* @return The time zone display name data.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
const TimeZoneNames* getTimeZoneNames() const;
* The caller should not delete the TimeZoenNames object after it is adopted
* by this call.
* @param tznames TimeZoneNames object to be adopted.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
void adoptTimeZoneNames(TimeZoneNames *tznames);
/**
* Sets the time zone display name data to this format instnace.
* @param tznames TimeZoneNames object to be set.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
void setTimeZoneNames(const TimeZoneNames &tznames);
* @param pattern Receives the localized GMT format pattern.
* @return A reference to the result pattern.
* @see #setGMTPattern
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UnicodeString& getGMTPattern(UnicodeString& pattern) const;
* @param pattern The localized GMT format pattern to be used by this object.
* @param status Recieves the status.
* @see #getGMTPattern
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
void setGMTPattern(const UnicodeString& pattern, UErrorCode& status);
* @param pattern Receives the offset pattern.
* @return A reference to the result pattern.
* @see #setGMTOffsetPattern
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UnicodeString& getGMTOffsetPattern(UTimeZoneFormatGMTOffsetPatternType type, UnicodeString& pattern) const;
* @param pattern The offset pattern used for localized GMT format for the type.
* @param status Receives the status.
* @see #getGMTOffsetPattern
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
void setGMTOffsetPattern(UTimeZoneFormatGMTOffsetPatternType type, const UnicodeString& pattern, UErrorCode& status);
/**
- * Returns the decimal digit characters used for localized GMT format in a single string
- * containing from 0 to 9 in the ascending order.
+ * Returns the decimal digit characters used for localized GMT format.
+ * The return string contains exactly 10 code points (may include Unicode
+ * supplementary character) representing digit 0 to digit 9 in the ascending
+ * order.
* @param digits Receives the decimal digits used for localized GMT format.
* @see #setGMTOffsetDigits
+ * @draft ICU 50
*/
UnicodeString& getGMTOffsetDigits(UnicodeString& digits) const;
/**
* Sets the decimal digit characters used for localized GMT format.
+ * The input <code>digits</code> must contain exactly 10 code points
+ * (Unicode supplementary characters are also allowed) representing
+ * digit 0 to digit 9 in the ascending order. When the input <code>digits</code>
+ * does not satisfy the condition, <code>U_ILLEGAL_ARGUMENT_ERROR</code>
+ * will be set to the return status.
* @param digits The decimal digits used for localized GMT format.
* @param status Receives the status.
* @see #getGMTOffsetDigits
+ * @draft ICU 50
*/
void setGMTOffsetDigits(const UnicodeString& digits, UErrorCode& status);
* @param gmtZeroFormat Receives the localized GMT string string for GMT(UTC) itself.
* @return A reference to the result GMT string.
* @see #setGMTZeroFormat
+ * @draft ICU 50
*/
UnicodeString& getGMTZeroFormat(UnicodeString& gmtZeroFormat) const;
* @param gmtZeroFormat The localized GMT format string for GMT(UTC).
* @param status Receives the status.
* @see #getGMTZeroFormat
+ * @draft ICU 50
*/
void setGMTZeroFormat(const UnicodeString& gmtZeroFormat, UErrorCode& status);
* options used by this object.
* @return the default parse options.
* @see ParseOption
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
- int32_t getDefaultParseOptions(void) const;
+ uint32_t getDefaultParseOptions(void) const;
/**
* Sets the default parse options.
* created by {@link #createInstance} has no parse options set (UTZFMT_PARSE_OPTION_NONE).
* To specify multipe options, use bitwise flags of UTimeZoneFormatParseOption.
* @see #UTimeZoneFormatParseOption
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
- void setDefaultParseOptions(int32_t flags);
+ void setDefaultParseOptions(uint32_t flags);
/**
* Returns the RFC822 style time zone string for the given offset.
* @return A reference to the result.
* @param status Receives the status
* @see #parseOffsetRFC822
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UnicodeString& formatOffsetRFC822(int32_t offset, UnicodeString& result, UErrorCode& status) const;
* @param status Receives the status
* @return A reference to the result.
* @see #parseOffsetISO8601
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UnicodeString& formatOffsetISO8601(int32_t offset, UnicodeString& result, UErrorCode& status) const;
* @param result Receives the localized GMT format string.
* @return A reference to the result.
* @see #parseOffsetLocalizedGMT
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UnicodeString& formatOffsetLocalizedGMT(int32_t offset, UnicodeString& result, UErrorCode& status) const;
* @return A reference to the result
* @see #UTimeZoneFormatStyle
* @see #UTimeZoneFormatTimeType
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& format(UTimeZoneFormatStyle style, const TimeZone& tz, UDate date,
UnicodeString& name, UTimeZoneFormatTimeType* timeType = NULL) const;
* @return The offset from GMT(UTC) in milliseconds for the given RFC822 style
* time zone string.
* @see #formatOffsetRFC822
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
int32_t parseOffsetRFC822(const UnicodeString& text, ParsePosition& pos) const;
* style time zone string. When the given string is not an ISO 8601 time zone
* string, this method sets the current position as the error index
* to <code>ParsePosition pos</code> and returns 0.
- * @param text The text contains RFC822 style time zone string (e.g. "-08:00", "Z")
+ * @param text The text contains ISO8601 style time zone string (e.g. "-08:00", "Z")
* at the position.
* @param pos The ParsePosition object.
* @return The offset from GMT(UTC) in milliseconds for the given ISO 8601 style
* time zone string.
* @see #formatOffsetISO8601
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
int32_t parseOffsetISO8601(const UnicodeString& text, ParsePosition& pos) const;
* @return The offset from GMT(UTC) in milliseconds for the given localized GMT
* offset format string.
* @see #formatOffsetLocalizedGMT
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
int32_t parseOffsetLocalizedGMT(const UnicodeString& text, ParsePosition& pos) const;
* @see UTimeZoneFormatStyle
* @see UTimeZoneFormatParseOption
* @see UTimeZoneFormatTimeType
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual TimeZone* parse(UTimeZoneFormatStyle style, const UnicodeString& text, ParsePosition& pos,
int32_t parseOptions, UTimeZoneFormatTimeType* timeType = NULL) const;
* @see UTimeZoneFormatStyle
* @see UTimeZoneFormatParseOption
* @see UTimeZoneFormatTimeType
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
TimeZone* parse(UTimeZoneFormatStyle style, const UnicodeString& text, ParsePosition& pos,
UTimeZoneFormatTimeType* timeType = NULL) const;
* @param pos On input: an alignment field, if desired. On output: the offsets of the alignment field.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo,
FieldPosition& pos, UErrorCode& status) const;
* will remain unchanged.
* @return A newly created Formattable* object, or NULL on failure. The caller owns this and should
* delete it when done.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual void parseObject(const UnicodeString& source, Formattable& result, ParsePosition& parse_pos) const;
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UClassID getDynamicClassID() const;
* Constructs a TimeZoneFormat object for the specified locale.
* @param locale the locale
* @param status receives the status.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
TimeZoneFormat(const Locale& locale, UErrorCode& status);
UnicodeString fGMTZeroFormat;
/* Bit flags representing parse options */
- int32_t fDefParseOptionFlags;
+ uint32_t fDefParseOptionFlags;
/* Constant parts of GMT format pattern, populated from localized GMT format pattern*/
UnicodeString fGMTPatternPrefix; /* Substring before {0} */
/**
* Constants for time zone display name types.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
typedef enum UTimeZoneNameType {
/**
* Unknown display name type.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZNM_UNKNOWN = 0x00,
/**
* Long display name, such as "Eastern Time".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZNM_LONG_GENERIC = 0x01,
/**
* Long display name for standard time, such as "Eastern Standard Time".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZNM_LONG_STANDARD = 0x02,
/**
* Long display name for daylight saving time, such as "Eastern Daylight Time".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZNM_LONG_DAYLIGHT = 0x04,
/**
* Short display name, such as "ET".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZNM_SHORT_GENERIC = 0x08,
/**
* Short display name for standard time, such as "EST".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZNM_SHORT_STANDARD = 0x10,
/**
* Short display name for daylight saving time, such as "EDT".
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UTZNM_SHORT_DAYLIGHT = 0x20
} UTimeZoneNameType;
* may provide time zone names only through {@link #getTimeZoneDisplayName}, or only through {@link #getMetaZoneDisplayName},
* or both.
*
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
class U_I18N_API TimeZoneNames : public UObject {
public:
/**
* Destructor.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual ~TimeZoneNames();
* Return true if the given TimeZoneNames objects are emantically equal.
* @param other the object to be compared with.
* @return Return TRUE if the given Format objects are semantically equal.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UBool operator==(const TimeZoneNames& other) const = 0;
* equal.
* @param other the object to be compared with.
* @return Return TRUE if the given Format objects are not semantically equal.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
UBool operator!=(const TimeZoneNames& other) const { return !operator==(other); }
* Clone this object polymorphically. The caller is responsible
* for deleting the result when done.
* @return A copy of the object
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual TimeZoneNames* clone() const = 0;
* @param locale The locale.
* @param status Recevies the status.
* @return An instance of <code>TimeZoneDisplayNames</code>
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
static TimeZoneNames* U_EXPORT2 createInstance(const Locale& locale, UErrorCode& status);
* Returns an enumeration of all available meta zone IDs.
* @param status Recevies the status.
* @return an enumeration object, owned by the caller.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const = 0;
* @param tzID The canoical tiem zone ID.
* @param status Recevies the status.
* @return an enumeration object, owned by the caller.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual StringEnumeration* getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCode& status) const = 0;
* corresponding meta zone at the given date or the implementation does not support meta zones, "bogus" state
* is set.
* @return A reference to the result.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate date, UnicodeString& mzID) const = 0;
* region. If the meta zone is unknown or the implementation does not support meta zones, "bogus" state
* is set.
* @return A reference to the result.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& getReferenceZoneID(const UnicodeString& mzID, const char* region, UnicodeString& tzID) const = 0;
* meta zone with the specified type or the implementation does not provide any display names associated
* with meta zones, "bogus" state is set.
* @return A reference to the result.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& getMetaZoneDisplayName(const UnicodeString& mzID, UTimeZoneNameType type, UnicodeString& name) const = 0;
* @param name Receives the display name for the time zone. When this object does not have a localized display name for the given
* time zone with the specified type, "bogus" state is set.
* @return A reference to the result.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UnicodeString& name) const = 0;
* @param name Receives the exemplar location name for the given time zone, or "bogus" state is set when a localized
* location name is not available and the fallback logic described above cannot extract location from the ID.
* @return A reference to the result.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& getExemplarLocationName(const UnicodeString& tzID, UnicodeString& name) const;
* @param name Receives the display name for the time zone at the given date. When this object does not have a localized display
* name for the time zone with the specified type and date, "bogus" state is set.
* @return A reference to the result.
- * @internal ICU 49 technology preview
+ * @draft ICU 50
*/
virtual UnicodeString& getDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UDate date, UnicodeString& name) const;
/**
* <code>MatchInfoCollection</code> represents a collection of time zone name matches used by
* {@link TimeZoneNames#find}.
- * @internal ICU 49 technology preview
+ * @internal
*/
class U_I18N_API MatchInfoCollection : public UMemory {
public:
/**
* Constructor.
- * @internal ICU 49 technology preview
+ * @internal
*/
MatchInfoCollection();
/**
* Destructor.
- * @internal ICU 49 technology preview
+ * @internal
*/
virtual ~MatchInfoCollection();
* @param matchLength The match length.
* @param tzID The time zone ID.
* @param status Receives the status
- * @internal ICU 49 technology preview
+ * @internal
*/
void addZone(UTimeZoneNameType nameType, int32_t matchLength,
const UnicodeString& tzID, UErrorCode& status);
* @param matchLength The match length.
* @param mzID The metazone ID.
* @param status Receives the status
- * @internal ICU 49 technology preview
+ * @internal
*/
void addMetaZone(UTimeZoneNameType nameType, int32_t matchLength,
const UnicodeString& mzID, UErrorCode& status);
/**
* Returns the number of entries available in this object.
* @return The number of entries.
- * @internal ICU 49 technology preview
+ * @internal
*/
int32_t size() const;
* @return The time zone name type. If the specified idx is out of range,
* it returns UTZNM_UNKNOWN.
* @see UTimeZoneNameType
- * @internal ICU 49 technology preview
+ * @internal
*/
UTimeZoneNameType getNameTypeAt(int32_t idx) const;
* @param idx The index
* @return The match length. If the specified idx is out of range,
* it returns 0.
- * @internal ICU 49 technology preview
+ * @internal
*/
int32_t getMatchLengthAt(int32_t idx) const;
* @param idx The index
* @param tzID Receives the zone ID.
* @return TRUE if the zone ID was set to tzID.
- * @internal ICU 49 technology preview
+ * @internal
*/
UBool getTimeZoneIDAt(int32_t idx, UnicodeString& tzID) const;
* @param idx The index
* @param mzID Receives the metazone ID
* @return TRUE if the meta zone ID was set to mzID.
- * @internal ICU 49 technology preview
+ * @internal
*/
UBool getMetaZoneIDAt(int32_t idx, UnicodeString& mzID) const;
* @return A collection of matches (owned by the caller), or NULL if no matches are found.
* @see UTimeZoneNameType
* @see MatchInfoCollection
- * @internal ICU 49 technology preview
+ * @internal
*/
virtual MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const = 0;