Skip to content

Commit

Permalink
ICU-22534 Promote (almost) all @draft ICU 73 APIs to @stable ICU 73
Browse files Browse the repository at this point in the history
  • Loading branch information
richgillam committed Mar 5, 2024
1 parent 232362b commit c610d7f
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 67 deletions.
4 changes: 1 addition & 3 deletions icu4c/source/common/unicode/uset.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ enum {
*/
USET_ADD_CASE_MAPPINGS = 4,

#ifndef U_HIDE_DRAFT_API
/**
* Enable case insensitive matching.
* Same as USET_CASE_INSENSITIVE but using only Simple_Case_Folding (scf) mappings,
Expand All @@ -120,10 +119,9 @@ enum {
* regular expression implementations where only Simple_Case_Folding mappings are used,
* such as in ECMAScript (JavaScript) regular expressions.
*
* @draft ICU 73
* @stable ICU 73
*/
USET_SIMPLE_CASE_INSENSITIVE = 6
#endif // U_HIDE_DRAFT_API
};

/**
Expand Down
9 changes: 3 additions & 6 deletions icu4c/source/i18n/unicode/calendar.h
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,6 @@ class U_I18N_API Calendar : public UObject {
*/
virtual UBool isWeekend() const;

#ifndef U_FORCE_HIDE_DRAFT_API
/**
* Returns true if the date is in a leap year. Recalculate the current time
* field values if the time value has been changed by a call to * setTime().
Expand All @@ -1363,7 +1362,7 @@ class U_I18N_API Calendar : public UObject {
* @param status ICU Error Code
* @return True if the date in the fields is in a Temporal proposal
* defined leap year. False otherwise.
* @draft ICU 73
* @stable ICU 73
*/
virtual bool inTemporalLeapYear(UErrorCode& status) const;

Expand All @@ -1383,7 +1382,7 @@ class U_I18N_API Calendar : public UObject {
*
* @param status ICU Error Code
* @return One of 25 possible strings in {"M01".."M13", "M01L".."M12L"}.
* @draft ICU 73
* @stable ICU 73
*/
virtual const char* getTemporalMonthCode(UErrorCode& status) const;

Expand All @@ -1404,12 +1403,10 @@ class U_I18N_API Calendar : public UObject {
* @param temporalMonth The value to be set for temporal monthCode.
* @param status ICU Error Code
*
* @draft ICU 73
* @stable ICU 73
*/
virtual void setTemporalMonthCode(const char* temporalMonth, UErrorCode& status);

#endif // U_FORCE_HIDE_DRAFT_API

protected:

/**
Expand Down
6 changes: 2 additions & 4 deletions icu4c/source/i18n/unicode/measunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -3068,23 +3068,21 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit getPoundPerSquareInch();

#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of speed: beaufort.
* Caller owns returned value and must free it.
* Also see {@link #getBeaufort()}.
* @param status ICU error code.
* @draft ICU 73
* @stable ICU 73
*/
static MeasureUnit *createBeaufort(UErrorCode &status);

/**
* Returns by value, unit of speed: beaufort.
* Also see {@link #createBeaufort()}.
* @draft ICU 73
* @stable ICU 73
*/
static MeasureUnit getBeaufort();
#endif /* U_HIDE_DRAFT_API */

/**
* Returns by pointer, unit of speed: kilometer-per-hour.
Expand Down
8 changes: 3 additions & 5 deletions icu4c/source/i18n/unicode/numfmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,21 @@ class U_I18N_API NumberFormat : public Format {
* @stable ICU 4.8
*/
kRoundUnnecessary,
#ifndef U_HIDE_DRAFT_API
/**
* Rounds ties toward the odd number.
* @draft ICU 73
* @stable ICU 73
*/
kRoundHalfOdd,
/**
* Rounds ties toward +∞.
* @draft ICU 73
* @stable ICU 73
*/
kRoundHalfCeiling,
/**
* Rounds ties toward -∞.
* @draft ICU 73
* @stable ICU 73
*/
kRoundHalfFloor,
#endif /* U_HIDE_DRAFT_API */
};

/**
Expand Down
43 changes: 20 additions & 23 deletions icu4c/source/i18n/unicode/simplenumberformatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,19 @@ class AdoptingSignumModifierStore;
} // icu::number::impl


#ifndef U_HIDE_DRAFT_API


/**
* An input type for SimpleNumberFormatter.
*
* This class is mutable and not intended for public subclassing. This class is movable but not copyable.
*
* @draft ICU 73
* @stable ICU 73
*/
class U_I18N_API SimpleNumber : public UMemory {
public:
/**
* Creates a SimpleNumber for an integer.
*
* @draft ICU 73
* @stable ICU 73
*/
static SimpleNumber forInt64(int64_t value, UErrorCode& status);

Expand All @@ -67,10 +64,11 @@ class U_I18N_API SimpleNumber : public UMemory {
*
* This function immediately mutates the inner value.
*
* @draft ICU 73
* @stable ICU 73
*/
void multiplyByPowerOfTen(int32_t power, UErrorCode& status);

#ifndef U_HIDE_DRAFT_API
/**
* Rounds the value currently stored in the SimpleNumber to the given power of 10.
*
Expand Down Expand Up @@ -107,14 +105,15 @@ class U_I18N_API SimpleNumber : public UMemory {
*/
void setMinimumFractionDigits(uint32_t minimumFractionDigits, UErrorCode& status);

#endif // U_HIDE_DRAFT_API
/**
* Sets the sign of the number: an explicit plus sign, explicit minus sign, or no sign.
*
* This setting is applied upon formatting the number.
*
* NOTE: This does not support accounting sign notation.
*
* @draft ICU 73
* @stable ICU 73
*/
void setSign(USimpleNumberSign sign, UErrorCode& status);

Expand All @@ -123,14 +122,14 @@ class U_I18N_API SimpleNumber : public UMemory {
*
* NOTE: This number will fail to format; use forInt64() to create a SimpleNumber with a value.
*
* @draft ICU 73
* @stable ICU 73
*/
SimpleNumber() = default;

/**
* Destruct this SimpleNumber, cleaning up any memory it might own.
*
* @draft ICU 73
* @stable ICU 73
*/
~SimpleNumber() {
cleanup();
Expand All @@ -139,7 +138,7 @@ class U_I18N_API SimpleNumber : public UMemory {
/**
* SimpleNumber move constructor.
*
* @draft ICU 73
* @stable ICU 73
*/
SimpleNumber(SimpleNumber&& other) noexcept {
fData = other.fData;
Expand All @@ -150,7 +149,7 @@ class U_I18N_API SimpleNumber : public UMemory {
/**
* SimpleNumber move assignment.
*
* @draft ICU 73
* @stable ICU 73
*/
SimpleNumber& operator=(SimpleNumber&& other) noexcept {
cleanup();
Expand Down Expand Up @@ -185,14 +184,14 @@ class U_I18N_API SimpleNumber : public UMemory {
*
* This class is immutable and not intended for public subclassing. This class is movable but not copyable.
*
* @draft ICU 73
* @stable ICU 73
*/
class U_I18N_API SimpleNumberFormatter : public UMemory {
public:
/**
* Creates a new SimpleNumberFormatter with all locale defaults.
*
* @draft ICU 73
* @stable ICU 73
*/
static SimpleNumberFormatter forLocale(
const icu::Locale &locale,
Expand All @@ -201,7 +200,7 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
/**
* Creates a new SimpleNumberFormatter, overriding the grouping strategy.
*
* @draft ICU 73
* @stable ICU 73
*/
static SimpleNumberFormatter forLocaleAndGroupingStrategy(
const icu::Locale &locale,
Expand All @@ -214,7 +213,7 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
* IMPORTANT: For efficiency, this function borrows the symbols. The symbols MUST remain valid
* for the lifetime of the SimpleNumberFormatter.
*
* @draft ICU 73
* @stable ICU 73
*/
static SimpleNumberFormatter forLocaleAndSymbolsAndGroupingStrategy(
const icu::Locale &locale,
Expand All @@ -228,7 +227,7 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
* The SimpleNumber argument is "consumed". A new SimpleNumber object should be created for
* every formatting operation.
*
* @draft ICU 73
* @stable ICU 73
*/
FormattedNumber format(SimpleNumber value, UErrorCode &status) const;

Expand All @@ -237,7 +236,7 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
*
* For more control over the formatting, use SimpleNumber.
*
* @draft ICU 73
* @stable ICU 73
*/
FormattedNumber formatInt64(int64_t value, UErrorCode &status) const {
return format(SimpleNumber::forInt64(value, status), status);
Expand All @@ -254,7 +253,7 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
/**
* Destruct this SimpleNumberFormatter, cleaning up any memory it might own.
*
* @draft ICU 73
* @stable ICU 73
*/
~SimpleNumberFormatter() {
cleanup();
Expand All @@ -263,14 +262,14 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
/**
* Creates a shell, initialized but non-functional SimpleNumberFormatter.
*
* @draft ICU 73
* @stable ICU 73
*/
SimpleNumberFormatter() = default;

/**
* SimpleNumberFormatter: Move constructor.
*
* @draft ICU 73
* @stable ICU 73
*/
SimpleNumberFormatter(SimpleNumberFormatter&& other) noexcept {
fGroupingStrategy = other.fGroupingStrategy;
Expand All @@ -285,7 +284,7 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
/**
* SimpleNumberFormatter: Move assignment.
*
* @draft ICU 73
* @stable ICU 73
*/
SimpleNumberFormatter& operator=(SimpleNumberFormatter&& other) noexcept {
cleanup();
Expand Down Expand Up @@ -321,8 +320,6 @@ class U_I18N_API SimpleNumberFormatter : public UMemory {
};


#endif // U_HIDE_DRAFT_API

} // namespace number
U_NAMESPACE_END

Expand Down
4 changes: 1 addition & 3 deletions icu4c/source/i18n/unicode/ucal.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ enum UCalendarDateFields {
*/
UCAL_IS_LEAP_MONTH,

#ifndef U_HIDE_DRAFT_API
/**
* Field number indicating the month. This is a calendar-specific value.
* Differ from UCAL_MONTH, this value is continuous and unique within a
Expand All @@ -464,10 +463,9 @@ enum UCalendarDateFields {
* and there is an extra "Leap Month 5" which associated with UCAL_ORDINAL_MONTH
* value 5 before "Month 6" of year 4664.
*
* @draft ICU 73
* @stable ICU 73
*/
UCAL_ORDINAL_MONTH,
#endif // U_HIDE_DRAFT_API

/* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
* it is needed for layout of Calendar, DateFormat, and other objects */
Expand Down
Loading

0 comments on commit c610d7f

Please sign in to comment.