| Index: source/i18n/unicode/measfmt.h
|
| diff --git a/source/i18n/unicode/measfmt.h b/source/i18n/unicode/measfmt.h
|
| index 91e08ef8d82c76649e0e0cfa563caebe542e4cf9..61a1e86d9c431e7c18a48ccb976e37c16ed82c1b 100644
|
| --- a/source/i18n/unicode/measfmt.h
|
| +++ b/source/i18n/unicode/measfmt.h
|
| @@ -1,6 +1,6 @@
|
| /*
|
| **********************************************************************
|
| -* Copyright (c) 2004-2014, International Business Machines
|
| +* Copyright (c) 2004-2015, International Business Machines
|
| * Corporation and others. All Rights Reserved.
|
| **********************************************************************
|
| * Author: Alan Liu
|
| @@ -29,45 +29,43 @@
|
| * For example, for English, when formatting "3 hours"
|
| * Wide is "3 hours"; short is "3 hrs"; narrow is "3h";
|
| * formatting "3 hours 17 minutes" as numeric give "3:17"
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| enum UMeasureFormatWidth {
|
|
|
| -#ifndef U_HIDE_DRAFT_API
|
| // Wide, short, and narrow must be first and in this order.
|
| /**
|
| * Spell out measure units.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| UMEASFMT_WIDTH_WIDE,
|
|
|
| /**
|
| * Abbreviate measure units.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| UMEASFMT_WIDTH_SHORT,
|
|
|
| /**
|
| * Use symbols for measure units when possible.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| UMEASFMT_WIDTH_NARROW,
|
|
|
| /**
|
| * Completely omit measure units when possible. For example, format
|
| * '5 hours, 37 minutes' as '5:37'
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| UMEASFMT_WIDTH_NUMERIC,
|
| -#endif /* U_HIDE_DRAFT_API */
|
|
|
| /**
|
| * Count of values in this enum.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| UMEASFMT_WIDTH_COUNT = 4
|
| };
|
| -/** @draft ICU 53 */
|
| +/** @stable ICU 53 */
|
| typedef enum UMeasureFormatWidth UMeasureFormatWidth;
|
|
|
| U_NAMESPACE_BEGIN
|
| @@ -97,34 +95,32 @@ class U_I18N_API MeasureFormat : public Format {
|
| using Format::parseObject;
|
| using Format::format;
|
|
|
| -#ifndef U_HIDE_DRAFT_API
|
| /**
|
| * Constructor.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| MeasureFormat(
|
| const Locale &locale, UMeasureFormatWidth width, UErrorCode &status);
|
|
|
| /**
|
| * Constructor.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| MeasureFormat(
|
| const Locale &locale,
|
| UMeasureFormatWidth width,
|
| NumberFormat *nfToAdopt,
|
| UErrorCode &status);
|
| -#endif /* U_HIDE_DRAFT_API */
|
|
|
| /**
|
| * Copy constructor.
|
| - * @draft ICU 53
|
| + * @stable ICU 3.0
|
| */
|
| MeasureFormat(const MeasureFormat &other);
|
|
|
| /**
|
| * Assignment operator.
|
| - * @draft ICU 53
|
| + * @stable ICU 3.0
|
| */
|
| MeasureFormat &operator=(const MeasureFormat &rhs);
|
|
|
| @@ -136,19 +132,19 @@ class U_I18N_API MeasureFormat : public Format {
|
|
|
| /**
|
| * Return true if given Format objects are semantically equal.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| virtual UBool operator==(const Format &other) const;
|
|
|
| /**
|
| * Clones this object polymorphically.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| virtual Format *clone() const;
|
|
|
| /**
|
| * Formats object to produce a string.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| virtual UnicodeString &format(
|
| const Formattable &obj,
|
| @@ -167,7 +163,6 @@ class U_I18N_API MeasureFormat : public Format {
|
| Formattable &reslt,
|
| ParsePosition &pos) const;
|
|
|
| -#ifndef U_HIDE_DRAFT_API
|
| /**
|
| * Formats measure objects to produce a string. An example of such a
|
| * formatted string is 3 meters, 3.5 centimeters. Measure objects appear
|
| @@ -182,7 +177,7 @@ class U_I18N_API MeasureFormat : public Format {
|
| * @param status the error.
|
| * @return appendTo reference
|
| *
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| UnicodeString &formatMeasures(
|
| const Measure *measures,
|
| @@ -190,31 +185,29 @@ class U_I18N_API MeasureFormat : public Format {
|
| UnicodeString &appendTo,
|
| FieldPosition &pos,
|
| UErrorCode &status) const;
|
| -#endif /* U_HIDE_DRAFT_API */
|
|
|
| -#ifndef U_HIDE_INTERNAL_API
|
| +#ifndef U_HIDE_DRAFT_API
|
| /**
|
| - * Works like formatMeasures but adds a per unit. An example of such a
|
| - * formatted string is 3 meters, 3.5 centimeters per second.
|
| - * @param measures array of measure objects.
|
| - * @param measureCount the number of measure objects.
|
| - * @param perUnit The per unit. In the example formatted string,
|
| - * it is *MeasureUnit::createSecond(status).
|
| + * Formats a single measure per unit. An example of such a
|
| + * formatted string is 3.5 meters per second.
|
| + * @param measure The measure object. In above example, 3.5 meters.
|
| + * @param perUnit The per unit. In above example, it is
|
| + * *MeasureUnit::createSecond(status).
|
| * @param appendTo formatted string appended here.
|
| * @param pos the field position.
|
| * @param status the error.
|
| * @return appendTo reference
|
| *
|
| - * @internal Technology preview
|
| + * @draft ICU 55
|
| */
|
| - UnicodeString &formatMeasuresPer(
|
| - const Measure *measures,
|
| - int32_t measureCount,
|
| + UnicodeString &formatMeasurePerUnit(
|
| + const Measure &measure,
|
| const MeasureUnit &perUnit,
|
| UnicodeString &appendTo,
|
| FieldPosition &pos,
|
| UErrorCode &status) const;
|
| -#endif /* U_HIDE_INTERNAL_API */
|
| +
|
| +#endif /* U_HIDE_DRAFT_API */
|
|
|
| /**
|
| * Return a formatter for CurrencyAmount objects in the given
|
| @@ -245,7 +238,7 @@ class U_I18N_API MeasureFormat : public Format {
|
| * . erived::getStaticClassID()) ...
|
| * </pre>
|
| * @return The class ID for all objects of this class.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| static UClassID U_EXPORT2 getStaticClassID(void);
|
|
|
| @@ -258,7 +251,7 @@ class U_I18N_API MeasureFormat : public Format {
|
| * @return The class ID for this object. All objects of a
|
| * given class have the same class ID. Objects of
|
| * other classes have different class IDs.
|
| - * @draft ICU 53
|
| + * @stable ICU 53
|
| */
|
| virtual UClassID getDynamicClassID(void) const;
|
|
|
| @@ -347,7 +340,7 @@ class U_I18N_API MeasureFormat : public Format {
|
| int32_t widthIndex,
|
| UErrorCode &status) const;
|
|
|
| - int32_t withPerUnit(
|
| + int32_t withPerUnitAndAppend(
|
| const UnicodeString &formatted,
|
| const MeasureUnit &perUnit,
|
| UnicodeString &appendTo,
|
|
|