From 0e4b768289b9511632d48f6fc8d62793190b3bc0 Mon Sep 17 00:00:00 2001 From: Rich Gillam <62772518+richgillam@users.noreply.github.com> Date: Fri, 2 Jul 2021 14:43:29 -0700 Subject: [PATCH] ICU-21581 Promoted @draft 68 APIs to stable --- icu4c/source/common/unicode/localematcher.h | 12 +-- icu4c/source/common/unicode/ucurr.h | 6 +- icu4c/source/common/unicode/utypes.h | 4 +- icu4c/source/i18n/unicode/dtitvfmt.h | 6 +- icu4c/source/i18n/unicode/measunit.h | 80 ++++++------------- icu4c/source/i18n/unicode/nounit.h | 11 +-- icu4c/source/i18n/unicode/numberformatter.h | 13 +-- .../i18n/unicode/numberrangeformatter.h | 8 +- icu4c/source/i18n/unicode/plurrule.h | 4 +- .../source/i18n/unicode/udateintervalformat.h | 7 +- icu4c/source/i18n/unicode/unum.h | 8 +- icu4c/source/i18n/unicode/unumberformatter.h | 10 +-- .../i18n/unicode/unumberrangeformatter.h | 32 ++++---- icu4c/source/i18n/unicode/upluralrules.h | 4 +- 14 files changed, 68 insertions(+), 137 deletions(-) diff --git a/icu4c/source/common/unicode/localematcher.h b/icu4c/source/common/unicode/localematcher.h index 0cd068ef328..252bb7fdc20 100644 --- a/icu4c/source/common/unicode/localematcher.h +++ b/icu4c/source/common/unicode/localematcher.h @@ -413,17 +413,15 @@ public: */ Builder &addSupportedLocale(const Locale &locale); -#ifndef U_HIDE_DRAFT_API /** * Sets no default locale. * There will be no explicit or implicit default locale. * If there is no good match, then the matcher will return nullptr for the * best supported locale. * - * @draft ICU 68 + * @stable ICU 68 */ Builder &setNoDefaultLocale(); -#endif // U_HIDE_DRAFT_API /** * Sets the default locale; if nullptr, or if it is not set explicitly, @@ -474,7 +472,6 @@ public: return *this; } -#ifndef U_HIDE_DRAFT_API /** * Sets the maximum distance for an acceptable match. * The matcher will return a match for a pair of locales only if @@ -494,10 +491,9 @@ public: * @param desired the desired locale for distance comparison. * @param supported the supported locale for distance comparison. * @return this Builder object - * @draft ICU 68 + * @stable ICU 68 */ Builder &setMaxDistance(const Locale &desired, const Locale &supported); -#endif // U_HIDE_DRAFT_API /** * Sets the UErrorCode if an error occurred while setting parameters. @@ -638,7 +634,6 @@ public: */ Result getBestMatchResult(Locale::Iterator &desiredLocales, UErrorCode &errorCode) const; -#ifndef U_HIDE_DRAFT_API /** * Returns true if the pair of locales matches acceptably. * This is influenced by Builder options such as setDirection(), setFavorSubtag(), @@ -650,10 +645,9 @@ public: * or else the function returns immediately. Check for U_FAILURE() * on output or use with function chaining. (See User Guide for details.) * @return true if the pair of locales matches acceptably. - * @draft ICU 68 + * @stable ICU 68 */ UBool isMatch(const Locale &desired, const Locale &supported, UErrorCode &errorCode) const; -#endif // U_HIDE_DRAFT_API #ifndef U_HIDE_INTERNAL_API /** diff --git a/icu4c/source/common/unicode/ucurr.h b/icu4c/source/common/unicode/ucurr.h index 35c2a393897..5589e799904 100644 --- a/icu4c/source/common/unicode/ucurr.h +++ b/icu4c/source/common/unicode/ucurr.h @@ -115,14 +115,13 @@ typedef enum UCurrNameStyle { */ UCURR_NARROW_SYMBOL_NAME, -#ifndef U_HIDE_DRAFT_API /** * Selector for getName() indicating the formal currency symbol. * The formal currency symbol is similar to the regular currency * symbol, but it always takes the form used in formal settings * such as banking; for example, "NT$" instead of "$" for TWD in zh-TW. * - * @draft ICU 68 + * @stable ICU 68 */ UCURR_FORMAL_SYMBOL_NAME, @@ -131,10 +130,9 @@ typedef enum UCurrNameStyle { * The variant symbol for a currency is an alternative symbol * that is not necessarily as widely used as the regular symbol. * - * @draft ICU 68 + * @stable ICU 68 */ UCURR_VARIANT_SYMBOL_NAME -#endif // U_HIDE_DRAFT_API } UCurrNameStyle; diff --git a/icu4c/source/common/unicode/utypes.h b/icu4c/source/common/unicode/utypes.h index 7c4ea7ac28d..a33a7c99219 100644 --- a/icu4c/source/common/unicode/utypes.h +++ b/icu4c/source/common/unicode/utypes.h @@ -479,16 +479,14 @@ typedef enum UErrorCode { U_COLLATOR_VERSION_MISMATCH = 28, /**< Collator version is not compatible with the base version */ U_USELESS_COLLATOR_ERROR = 29, /**< Collator is options only and no base is specified */ U_NO_WRITE_PERMISSION = 30, /**< Attempt to modify read-only or constant data. */ -#ifndef U_HIDE_DRAFT_API /** * The input is impractically long for an operation. * It is rejected because it may lead to problems such as excessive * processing time, stack depth, or heap memory requirements. * - * @draft ICU 68 + * @stable ICU 68 */ U_INPUT_TOO_LONG_ERROR = 31, -#endif // U_HIDE_DRAFT_API #ifndef U_HIDE_DEPRECATED_API /** diff --git a/icu4c/source/i18n/unicode/dtitvfmt.h b/icu4c/source/i18n/unicode/dtitvfmt.h index 015c78d3773..3ef26aac95b 100644 --- a/icu4c/source/i18n/unicode/dtitvfmt.h +++ b/icu4c/source/i18n/unicode/dtitvfmt.h @@ -652,7 +652,6 @@ public: */ virtual void setTimeZone(const TimeZone& zone); -#ifndef U_FORCE_HIDE_DRAFT_API /** * Set a particular UDisplayContext value in the formatter, such as * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. This causes the formatted @@ -663,7 +662,7 @@ public: * @param status Input/output status. If at entry this indicates a failure * status, the function will do nothing; otherwise this will be * updated with any new status from the function. - * @draft ICU 68 + * @stable ICU 68 */ virtual void setContext(UDisplayContext value, UErrorCode& status); @@ -675,10 +674,9 @@ public: * status, the function will do nothing; otherwise this will be * updated with any new status from the function. * @return The UDisplayContextValue for the specified type. - * @draft ICU 68 + * @stable ICU 68 */ virtual UDisplayContext getContext(UDisplayContextType type, UErrorCode& status) const; -#endif // U_FORCE_HIDE_DRAFT_API /** * Return the class ID for this class. This is useful only for comparing to diff --git a/icu4c/source/i18n/unicode/measunit.h b/icu4c/source/i18n/unicode/measunit.h index 8254c7b8fba..f7eefd2405f 100644 --- a/icu4c/source/i18n/unicode/measunit.h +++ b/icu4c/source/i18n/unicode/measunit.h @@ -577,7 +577,6 @@ class U_I18N_API MeasureUnit: public UObject { */ MeasureUnit product(const MeasureUnit& other, UErrorCode& status) const; -#ifndef U_HIDE_DRAFT_API /** * Gets the list of SINGLE units contained within a MIXED or COMPOUND unit. * @@ -591,10 +590,9 @@ class U_I18N_API MeasureUnit: public UObject { * * @param status Set if an error occurs. * @return A pair with the list of units as a LocalArray and the number of units in the list. - * @draft ICU 68 + * @stable ICU 68 */ inline std::pair, int32_t> splitToSingleUnits(UErrorCode& status) const; -#endif // U_HIDE_DRAFT_API /** * getAvailable gets all of the available units. @@ -1937,23 +1935,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getMegahertz(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of graphics: dot. * Caller owns returned value and must free it. * Also see {@link #getDot()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createDot(UErrorCode &status); /** * Returns by value, unit of graphics: dot. * Also see {@link #createDot()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getDot(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of graphics: dot-per-centimeter. @@ -2115,23 +2111,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getDecimeter(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of length: earth-radius. * Caller owns returned value and must free it. * Also see {@link #getEarthRadius()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createEarthRadius(UErrorCode &status); /** * Returns by value, unit of length: earth-radius. * Also see {@link #createEarthRadius()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getEarthRadius(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of length: fathom. @@ -2421,41 +2415,37 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getYard(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of light: candela. * Caller owns returned value and must free it. * Also see {@link #getCandela()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createCandela(UErrorCode &status); /** * Returns by value, unit of light: candela. * Also see {@link #createCandela()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getCandela(); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of light: lumen. * Caller owns returned value and must free it. * Also see {@link #getLumen()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createLumen(UErrorCode &status); /** * Returns by value, unit of light: lumen. * Also see {@link #createLumen()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getLumen(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of light: lux. @@ -2537,23 +2527,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getEarthMass(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of mass: grain. * Caller owns returned value and must free it. * Also see {@link #getGrain()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createGrain(UErrorCode &status); /** * Returns by value, unit of mass: grain. * Also see {@link #createGrain()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getGrain(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of mass: gram. @@ -3371,77 +3359,69 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getDeciliter(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of volume: dessert-spoon. * Caller owns returned value and must free it. * Also see {@link #getDessertSpoon()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createDessertSpoon(UErrorCode &status); /** * Returns by value, unit of volume: dessert-spoon. * Also see {@link #createDessertSpoon()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getDessertSpoon(); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of volume: dessert-spoon-imperial. * Caller owns returned value and must free it. * Also see {@link #getDessertSpoonImperial()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createDessertSpoonImperial(UErrorCode &status); /** * Returns by value, unit of volume: dessert-spoon-imperial. * Also see {@link #createDessertSpoonImperial()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getDessertSpoonImperial(); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of volume: dram. * Caller owns returned value and must free it. * Also see {@link #getDram()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createDram(UErrorCode &status); /** * Returns by value, unit of volume: dram. * Also see {@link #createDram()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getDram(); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of volume: drop. * Caller owns returned value and must free it. * Also see {@link #getDrop()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createDrop(UErrorCode &status); /** * Returns by value, unit of volume: drop. * Also see {@link #createDrop()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getDrop(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of volume: fluid-ounce. @@ -3523,23 +3503,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getHectoliter(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of volume: jigger. * Caller owns returned value and must free it. * Also see {@link #getJigger()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createJigger(UErrorCode &status); /** * Returns by value, unit of volume: jigger. * Also see {@link #createJigger()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getJigger(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of volume: liter. @@ -3589,23 +3567,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getMilliliter(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of volume: pinch. * Caller owns returned value and must free it. * Also see {@link #getPinch()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createPinch(UErrorCode &status); /** * Returns by value, unit of volume: pinch. * Also see {@link #createPinch()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getPinch(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of volume: pint. @@ -3655,23 +3631,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getQuart(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of volume: quart-imperial. * Caller owns returned value and must free it. * Also see {@link #getQuartImperial()}. * @param status ICU error code. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit *createQuartImperial(UErrorCode &status); /** * Returns by value, unit of volume: quart-imperial. * Also see {@link #createQuartImperial()}. - * @draft ICU 68 + * @stable ICU 68 */ static MeasureUnit getQuartImperial(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of volume: tablespoon. @@ -3760,15 +3734,13 @@ private: friend class number::impl::LongNameHandler; }; -#ifndef U_HIDE_DRAFT_API -// inline impl of @draft ICU 68 method +// inline impl of @stable ICU 68 method inline std::pair, int32_t> MeasureUnit::splitToSingleUnits(UErrorCode& status) const { int32_t length; auto array = splitToSingleUnitsImpl(length, status); return std::make_pair(std::move(array), length); } -#endif // U_HIDE_DRAFT_API U_NAMESPACE_END diff --git a/icu4c/source/i18n/unicode/nounit.h b/icu4c/source/i18n/unicode/nounit.h index cee45e352df..96aca35d013 100644 --- a/icu4c/source/i18n/unicode/nounit.h +++ b/icu4c/source/i18n/unicode/nounit.h @@ -18,8 +18,6 @@ #include "unicode/measunit.h" -#ifndef U_HIDE_DRAFT_API - /** * \file * \brief C++ API: units for percent and permille @@ -31,7 +29,7 @@ U_NAMESPACE_BEGIN * Dimensionless unit for percent and permille. * Prior to ICU 68, this namespace was a class with the same name. * @see NumberFormatter - * @draft ICU 68 + * @stable ICU 68 */ namespace NoUnit { /** @@ -42,7 +40,7 @@ namespace NoUnit { * Since ICU 68, this function returns the same value as the default MeasureUnit constructor. * * @return a MeasureUnit instance - * @draft ICU 68 + * @stable ICU 68 */ static inline MeasureUnit U_EXPORT2 base() { return MeasureUnit(); @@ -56,7 +54,7 @@ namespace NoUnit { * Since ICU 68, this function returns the same value as MeasureUnit::getPercent(). * * @return a MeasureUnit instance - * @draft ICU 68 + * @stable ICU 68 */ static inline MeasureUnit U_EXPORT2 percent() { return MeasureUnit::getPercent(); @@ -70,7 +68,7 @@ namespace NoUnit { * Since ICU 68, this function returns the same value as MeasureUnit::getPermille(). * * @return a MeasureUnit instance - * @draft ICU 68 + * @stable ICU 68 */ static inline MeasureUnit U_EXPORT2 permille() { return MeasureUnit::getPermille(); @@ -79,7 +77,6 @@ namespace NoUnit { U_NAMESPACE_END -#endif /* U_HIDE_DRAFT_API */ #endif /* #if !UCONFIG_NO_FORMATTING */ #endif /* U_SHOW_CPLUSPLUS_API */ diff --git a/icu4c/source/i18n/unicode/numberformatter.h b/icu4c/source/i18n/unicode/numberformatter.h index 7f4c7ad7c19..7a4adb3a495 100644 --- a/icu4c/source/i18n/unicode/numberformatter.h +++ b/icu4c/source/i18n/unicode/numberformatter.h @@ -2164,7 +2164,6 @@ class U_I18N_API NumberFormatterSettings { */ Derived scale(const Scale &scale) &&; -#ifndef U_HIDE_DRAFT_API /** * Specifies the usage for which numbers will be formatted ("person-height", * "road", "rainfall", etc.) @@ -2205,7 +2204,7 @@ class U_I18N_API NumberFormatterSettings { * `unitPreferenceData` in [CLDR's * supplemental/units.xml](https://github.com/unicode-org/cldr/blob/main/common/supplemental/units.xml). * @return The fluent chain. - * @draft ICU 68 + * @stable ICU 68 */ Derived usage(StringPiece usage) const &; @@ -2214,10 +2213,9 @@ class U_I18N_API NumberFormatterSettings { * * @param usage The unit `usage`. * @return The fluent chain. - * @draft ICU 68 + * @stable ICU 68 */ Derived usage(StringPiece usage) &&; -#endif // U_HIDE_DRAFT_API #ifndef U_HIDE_DRAFT_API #ifndef U_HIDE_INTERNAL_API @@ -2715,7 +2713,6 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue { template inline StringClass toDecimalNumber(UErrorCode& status) const; -#ifndef U_HIDE_DRAFT_API /** * Gets the resolved output unit. * @@ -2725,10 +2722,11 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue { * as "foot-and-inch" or "hour-and-minute-and-second". * * @return `MeasureUnit`. - * @draft ICU 68 + * @stable ICU 68 */ MeasureUnit getOutputUnit(UErrorCode& status) const; +#ifndef U_HIDE_INTERNAL_API /** * Gets the gender of the formatted output. Returns "" when the gender is * unknown, or for ungendered languages. @@ -2736,9 +2734,6 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue { * @internal ICU 69 technology preview. */ const char *getGender(UErrorCode& status) const; -#endif // U_HIDE_DRAFT_API - -#ifndef U_HIDE_INTERNAL_API /** * Gets the raw DecimalQuantity for plural rule selection. diff --git a/icu4c/source/i18n/unicode/numberrangeformatter.h b/icu4c/source/i18n/unicode/numberrangeformatter.h index b9a4600cb6e..091fc66442a 100644 --- a/icu4c/source/i18n/unicode/numberrangeformatter.h +++ b/icu4c/source/i18n/unicode/numberrangeformatter.h @@ -608,7 +608,6 @@ class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue { /** @copydoc FormattedValue::nextPosition() */ UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const U_OVERRIDE; -#ifndef U_HIDE_DRAFT_API /** * Extracts the formatted range as a pair of decimal numbers. This endpoint * is useful for obtaining the exact number being printed after scaling @@ -626,11 +625,10 @@ class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue { * for example, std::string. * @param status Set if an error occurs. * @return A pair of StringClasses containing the numeric strings. - * @draft ICU 68 + * @stable ICU 68 */ template inline std::pair getDecimalNumbers(UErrorCode& status) const; -#endif // U_HIDE_DRAFT_API /** * Returns whether the pair of numbers was successfully formatted as a range or whether an identity fallback was @@ -705,8 +703,7 @@ class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue { friend struct impl::UFormattedNumberRangeImpl; }; -#ifndef U_HIDE_DRAFT_API -// inline impl of @draft ICU 68 method +// inline impl of @stable ICU 68 method template std::pair FormattedNumberRange::getDecimalNumbers(UErrorCode& status) const { StringClass str1; @@ -716,7 +713,6 @@ std::pair FormattedNumberRange::getDecimalNumbers(UErr getDecimalNumbers(sink1, sink2, status); return std::make_pair(str1, str2); } -#endif // U_HIDE_DRAFT_API /** * See the main description in numberrangeformatter.h for documentation and examples. diff --git a/icu4c/source/i18n/unicode/plurrule.h b/icu4c/source/i18n/unicode/plurrule.h index 7b30f69b077..3d420a1d52f 100644 --- a/icu4c/source/i18n/unicode/plurrule.h +++ b/icu4c/source/i18n/unicode/plurrule.h @@ -373,7 +373,6 @@ public: */ UnicodeString select(const number::FormattedNumber& number, UErrorCode& status) const; -#ifndef U_HIDE_DRAFT_API /** * Given a formatted number range, returns the overall plural form of the * range. For example, "3-5" returns "other" in English. @@ -388,10 +387,9 @@ public: * This could happen if the FormattedNumberRange is invalid, * or if plural ranges data is unavailable. * @return The keyword of the selected rule. - * @draft ICU 68 + * @stable ICU 68 */ UnicodeString select(const number::FormattedNumberRange& range, UErrorCode& status) const; -#endif // U_HIDE_DRAFT_API #ifndef U_HIDE_INTERNAL_API /** diff --git a/icu4c/source/i18n/unicode/udateintervalformat.h b/icu4c/source/i18n/unicode/udateintervalformat.h index a8461f334ec..8439444d079 100644 --- a/icu4c/source/i18n/unicode/udateintervalformat.h +++ b/icu4c/source/i18n/unicode/udateintervalformat.h @@ -301,7 +301,6 @@ udtitvfmt_formatCalendarToResult( UFormattedDateInterval* result, UErrorCode* status); -#ifndef U_HIDE_DRAFT_API /** * Set a particular UDisplayContext value in the formatter, such as * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. This causes the formatted @@ -311,7 +310,7 @@ udtitvfmt_formatCalendarToResult( * @param formatter The formatter for which to set a UDisplayContext value. * @param value The UDisplayContext value to set. * @param status A pointer to an UErrorCode to receive any errors - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI void U_EXPORT2 udtitvfmt_setContext(UDateIntervalFormat* formatter, UDisplayContext value, UErrorCode* status); @@ -323,13 +322,11 @@ udtitvfmt_setContext(UDateIntervalFormat* formatter, UDisplayContext value, UErr * @param type The UDisplayContextType whose value to return * @param status A pointer to an UErrorCode to receive any errors * @return The UDisplayContextValue for the specified type. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI UDisplayContext U_EXPORT2 udtitvfmt_getContext(const UDateIntervalFormat* formatter, UDisplayContextType type, UErrorCode* status); -#endif /* U_HIDE_DRAFT_API */ - #endif /* #if !UCONFIG_NO_FORMATTING */ #endif diff --git a/icu4c/source/i18n/unicode/unum.h b/icu4c/source/i18n/unicode/unum.h index 15394106ab9..8bfdce60048 100644 --- a/icu4c/source/i18n/unicode/unum.h +++ b/icu4c/source/i18n/unicode/unum.h @@ -412,29 +412,27 @@ typedef enum UNumberFormatFields { } UNumberFormatFields; -#ifndef U_HIDE_DRAFT_API /** * Selectors with special numeric values to use locale default minimum grouping * digits for the DecimalFormat/UNumberFormat setMinimumGroupingDigits method. * Do not use these constants with the [U]NumberFormatter API. * - * @draft ICU 68 + * @stable ICU 68 */ typedef enum UNumberFormatMinimumGroupingDigits { /** * Display grouping using the default strategy for all locales. - * @draft ICU 68 + * @stable ICU 68 */ UNUM_MINIMUM_GROUPING_DIGITS_AUTO = -2, /** * Display grouping using locale defaults, except do not show grouping on * values smaller than 10000 (such that there is a minimum of two digits * before the first separator). - * @draft ICU 68 + * @stable ICU 68 */ UNUM_MINIMUM_GROUPING_DIGITS_MIN2 = -3, } UNumberFormatMinimumGroupingDigits; -#endif // U_HIDE_DRAFT_API /** * Create and return a new UNumberFormat for formatting and parsing diff --git a/icu4c/source/i18n/unicode/unumberformatter.h b/icu4c/source/i18n/unicode/unumberformatter.h index a448dfae61e..cb980cd94dd 100644 --- a/icu4c/source/i18n/unicode/unumberformatter.h +++ b/icu4c/source/i18n/unicode/unumberformatter.h @@ -204,7 +204,6 @@ typedef enum UNumberUnitWidth { */ UNUM_UNIT_WIDTH_ISO_CODE = 3, -#ifndef U_HIDE_DRAFT_API /** * Use the formal variant of the currency symbol; for example, "NT$" for the New Taiwan * dollar in zh-TW. @@ -212,7 +211,7 @@ typedef enum UNumberUnitWidth { *

* Behavior of this option with non-currency units is not defined at this time. * - * @draft ICU 68 + * @stable ICU 68 */ UNUM_UNIT_WIDTH_FORMAL = 4, @@ -223,10 +222,9 @@ typedef enum UNumberUnitWidth { *

* Behavior of this option with non-currency units is not defined at this time. * - * @draft ICU 68 + * @stable ICU 68 */ UNUM_UNIT_WIDTH_VARIANT = 5, -#endif // U_HIDE_DRAFT_API /** * Format the number according to the specified unit, but do not display the unit. For currencies, apply @@ -772,7 +770,6 @@ unumf_resultGetAllFieldPositions(const UFormattedNumber* uresult, UFieldPosition UErrorCode* ec); -#ifndef U_HIDE_DRAFT_API /** * Extracts the formatted number as a "numeric string" conforming to the * syntax defined in the Decimal Arithmetic Specification, available at @@ -789,7 +786,7 @@ unumf_resultGetAllFieldPositions(const UFormattedNumber* uresult, UFieldPosition * If U_BUFFER_OVERFLOW_ERROR: Returns number of chars for * preflighting. * @return Number of chars in the data. Does not include a trailing NUL. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI int32_t U_EXPORT2 unumf_resultToDecimalNumber( @@ -797,7 +794,6 @@ unumf_resultToDecimalNumber( char* dest, int32_t destCapacity, UErrorCode* ec); -#endif // U_HIDE_DRAFT_API /** diff --git a/icu4c/source/i18n/unicode/unumberrangeformatter.h b/icu4c/source/i18n/unicode/unumberrangeformatter.h index 5afef888dd5..e16849b761c 100644 --- a/icu4c/source/i18n/unicode/unumberrangeformatter.h +++ b/icu4c/source/i18n/unicode/unumberrangeformatter.h @@ -198,15 +198,13 @@ typedef enum UNumberRangeIdentityResult { } UNumberRangeIdentityResult; -#ifndef U_HIDE_DRAFT_API - struct UNumberRangeFormatter; /** * C-compatible version of icu::number::LocalizedNumberRangeFormatter. * * NOTE: This is a C-compatible API; C++ users should build against numberrangeformatter.h instead. * - * @draft ICU 68 + * @stable ICU 68 */ typedef struct UNumberRangeFormatter UNumberRangeFormatter; @@ -217,7 +215,7 @@ struct UFormattedNumberRange; * * NOTE: This is a C-compatible API; C++ users should build against numberrangeformatter.h instead. * - * @draft ICU 68 + * @stable ICU 68 */ typedef struct UFormattedNumberRange UFormattedNumberRange; @@ -241,7 +239,7 @@ typedef struct UFormattedNumberRange UFormattedNumberRange; * @param perror A parse error struct populated if an error occurs when parsing. Can be NULL. * If no error occurs, perror->offset will be set to -1. * @param ec Set if an error occurs. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI UNumberRangeFormatter* U_EXPORT2 unumrf_openForSkeletonWithCollapseAndIdentityFallback( @@ -260,7 +258,7 @@ unumrf_openForSkeletonWithCollapseAndIdentityFallback( * passed to a format function. * * @param ec Set if an error occurs. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI UFormattedNumberRange* U_EXPORT2 unumrf_openResult(UErrorCode* ec); @@ -279,7 +277,7 @@ unumrf_openResult(UErrorCode* ec); * @param second The second (usually larger) number in the range. * @param uresult The object that will be mutated to store the result; see unumrf_openResult. * @param ec Set if an error occurs. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI void U_EXPORT2 unumrf_formatDoubleRange( @@ -307,7 +305,7 @@ unumrf_formatDoubleRange( * @param secondLen The length of the second decimal number string. * @param uresult The object that will be mutated to store the result; see unumrf_openResult. * @param ec Set if an error occurs. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI void U_EXPORT2 unumrf_formatDecimalRange( @@ -332,7 +330,7 @@ unumrf_formatDecimalRange( * @param uresult The object containing the formatted number range. * @param ec Set if an error occurs. * @return A UFormattedValue owned by the input object. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI const UFormattedValue* U_EXPORT2 unumrf_resultAsValue(const UFormattedNumberRange* uresult, UErrorCode* ec); @@ -346,7 +344,7 @@ unumrf_resultAsValue(const UFormattedNumberRange* uresult, UErrorCode* ec); * @param uresult The object containing the formatted number range. * @param ec Set if an error occurs. * @return The identity result; see UNumberRangeIdentityResult. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI UNumberRangeIdentityResult U_EXPORT2 unumrf_resultGetIdentityResult( @@ -371,7 +369,7 @@ unumrf_resultGetIdentityResult( * If U_BUFFER_OVERFLOW_ERROR: Returns number of chars for * preflighting. * @return Number of chars in the data. Does not include a trailing NUL. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI int32_t U_EXPORT2 unumrf_resultGetFirstDecimalNumber( @@ -398,7 +396,7 @@ unumrf_resultGetFirstDecimalNumber( * If U_BUFFER_OVERFLOW_ERROR: Returns number of chars for * preflighting. * @return Number of chars in the data. Does not include a trailing NUL. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI int32_t U_EXPORT2 unumrf_resultGetSecondDecimalNumber( @@ -412,7 +410,7 @@ unumrf_resultGetSecondDecimalNumber( * Releases the UNumberFormatter created by unumf_openForSkeletonAndLocale(). * * @param uformatter An object created by unumf_openForSkeletonAndLocale(). - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI void U_EXPORT2 unumrf_close(UNumberRangeFormatter* uformatter); @@ -422,7 +420,7 @@ unumrf_close(UNumberRangeFormatter* uformatter); * Releases the UFormattedNumber created by unumf_openResult(). * * @param uresult An object created by unumf_openResult(). - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI void U_EXPORT2 unumrf_closeResult(UFormattedNumberRange* uresult); @@ -445,7 +443,7 @@ U_NAMESPACE_BEGIN * * @see LocalPointerBase * @see LocalPointer - * @draft ICU 68 + * @stable ICU 68 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalUNumberRangeFormatterPointer, UNumberRangeFormatter, unumrf_close); @@ -462,14 +460,12 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalUNumberRangeFormatterPointer, UNumberRangeForma * * @see LocalPointerBase * @see LocalPointer - * @draft ICU 68 + * @stable ICU 68 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedNumberRangePointer, UFormattedNumberRange, unumrf_closeResult); U_NAMESPACE_END #endif // U_SHOW_CPLUSPLUS_API -#endif // U_HIDE_DRAFT_API - #endif /* #if !UCONFIG_NO_FORMATTING */ #endif //__UNUMBERRANGEFORMATTER_H__ diff --git a/icu4c/source/i18n/unicode/upluralrules.h b/icu4c/source/i18n/unicode/upluralrules.h index 71a45ddf85b..2cf0e6998c4 100644 --- a/icu4c/source/i18n/unicode/upluralrules.h +++ b/icu4c/source/i18n/unicode/upluralrules.h @@ -180,7 +180,6 @@ uplrules_selectFormatted(const UPluralRules *uplrules, UChar *keyword, int32_t capacity, UErrorCode *status); -#ifndef U_HIDE_DRAFT_API /** * Given a formatted number range, returns the overall plural form of the * range. For example, "3-5" returns "other" in English. @@ -194,14 +193,13 @@ uplrules_selectFormatted(const UPluralRules *uplrules, * @param capacity The capacity of the keyword buffer. * @param status A pointer to a UErrorCode to receive any errors. * @return The length of the keyword. - * @draft ICU 68 + * @stable ICU 68 */ U_CAPI int32_t U_EXPORT2 uplrules_selectForRange(const UPluralRules *uplrules, const struct UFormattedNumberRange* urange, UChar *keyword, int32_t capacity, UErrorCode *status); -#endif // U_HIDE_DRAFT_API #ifndef U_HIDE_INTERNAL_API /** -- 2.40.0