ICU-21480 Promoted all @draft ICU 67 APIs to @stable ICU 67.
diff --git a/icu4c/source/common/unicode/bytestream.h b/icu4c/source/common/unicode/bytestream.h
index 044f7a7..9735ee0 100644
--- a/icu4c/source/common/unicode/bytestream.h
+++ b/icu4c/source/common/unicode/bytestream.h
@@ -71,7 +71,6 @@
*/
virtual void Append(const char* bytes, int32_t n) = 0;
-#ifndef U_HIDE_DRAFT_API
/**
* Appends n bytes to this. Same as Append().
* Call AppendU8() with u8"string literals" which are const char * in C++11
@@ -81,7 +80,7 @@
*
* @param bytes the pointer to the bytes
* @param n the number of bytes; must be non-negative
- * @draft ICU 67
+ * @stable ICU 67
*/
inline void AppendU8(const char* bytes, int32_t n) {
Append(bytes, n);
@@ -97,13 +96,12 @@
*
* @param bytes the pointer to the bytes
* @param n the number of bytes; must be non-negative
- * @draft ICU 67
+ * @stable ICU 67
*/
inline void AppendU8(const char8_t* bytes, int32_t n) {
Append(reinterpret_cast<const char*>(bytes), n);
}
#endif
-#endif // U_HIDE_DRAFT_API
/**
* Returns a writable buffer for appending and writes the buffer's capacity to
diff --git a/icu4c/source/common/unicode/localematcher.h b/icu4c/source/common/unicode/localematcher.h
index 63d20f2..0cd068e 100644
--- a/icu4c/source/common/unicode/localematcher.h
+++ b/icu4c/source/common/unicode/localematcher.h
@@ -91,8 +91,6 @@
typedef enum ULocMatchDemotion ULocMatchDemotion;
#endif
-#ifndef U_FORCE_HIDE_DRAFT_API
-
/**
* Builder option for whether to include or ignore one-way (fallback) match data.
* The LocaleMatcher uses CLDR languageMatch data which includes fallback (oneway=true) entries.
@@ -108,20 +106,20 @@
* but not if it is merely a fallback.
*
* @see LocaleMatcher::Builder#setDirection(ULocMatchDirection)
- * @draft ICU 67
+ * @stable ICU 67
*/
enum ULocMatchDirection {
/**
* Locale matching includes one-way matches such as Breton→French. (default)
*
- * @draft ICU 67
+ * @stable ICU 67
*/
ULOCMATCH_DIRECTION_WITH_ONE_WAY,
/**
* Locale matching limited to two-way matches including e.g. Danish↔Norwegian
* but ignoring one-way matches.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
ULOCMATCH_DIRECTION_ONLY_TWO_WAY
};
@@ -129,8 +127,6 @@
typedef enum ULocMatchDirection ULocMatchDirection;
#endif
-#endif // U_FORCE_HIDE_DRAFT_API
-
struct UHashtable;
U_NAMESPACE_BEGIN
@@ -463,14 +459,13 @@
*/
Builder &setDemotionPerDesiredLocale(ULocMatchDemotion demotion);
-#ifndef U_HIDE_DRAFT_API
/**
* Option for whether to include or ignore one-way (fallback) match data.
* By default, they are included.
*
* @param direction the match direction to set.
* @return this Builder object
- * @draft ICU 67
+ * @stable ICU 67
*/
Builder &setDirection(ULocMatchDirection direction) {
if (U_SUCCESS(errorCode_)) {
@@ -478,7 +473,6 @@
}
return *this;
}
-#endif // U_HIDE_DRAFT_API
#ifndef U_HIDE_DRAFT_API
/**
diff --git a/icu4c/source/common/unicode/locid.h b/icu4c/source/common/unicode/locid.h
index ba858d7..81f4685 100644
--- a/icu4c/source/common/unicode/locid.h
+++ b/icu4c/source/common/unicode/locid.h
@@ -571,15 +571,13 @@
*/
void minimizeSubtags(UErrorCode& status);
-#ifndef U_HIDE_DRAFT_API
/**
* Canonicalize the locale ID of this object according to CLDR.
* @param status the status code
- * @draft ICU 67
+ * @stable ICU 67
* @see createCanonical
*/
void canonicalize(UErrorCode& status);
-#endif // U_HIDE_DRAFT_API
/**
* Gets the list of keywords for the specified locale.
diff --git a/icu4c/source/common/unicode/stringpiece.h b/icu4c/source/common/unicode/stringpiece.h
index 7d7d871..8c96789 100644
--- a/icu4c/source/common/unicode/stringpiece.h
+++ b/icu4c/source/common/unicode/stringpiece.h
@@ -75,12 +75,11 @@
* @stable ICU 4.2
*/
StringPiece(const char* str);
-#ifndef U_HIDE_DRAFT_API
#if defined(__cpp_char8_t) || defined(U_IN_DOXYGEN)
/**
* Constructs from a NUL-terminated const char8_t * pointer.
* @param str a NUL-terminated const char8_t * pointer
- * @draft ICU 67
+ * @stable ICU 67
*/
StringPiece(const char8_t* str) : StringPiece(reinterpret_cast<const char*>(str)) {}
#endif
@@ -88,10 +87,9 @@
* Constructs an empty StringPiece.
* Needed for type disambiguation from multiple other overloads.
* @param p nullptr
- * @draft ICU 67
+ * @stable ICU 67
*/
StringPiece(std::nullptr_t p) : ptr_(p), length_(0) {}
-#endif // U_HIDE_DRAFT_API
/**
* Constructs from a std::string.
@@ -99,17 +97,15 @@
*/
StringPiece(const std::string& str)
: ptr_(str.data()), length_(static_cast<int32_t>(str.size())) { }
-#ifndef U_HIDE_DRAFT_API
#if defined(__cpp_lib_char8_t) || defined(U_IN_DOXYGEN)
/**
* Constructs from a std::u8string.
- * @draft ICU 67
+ * @stable ICU 67
*/
StringPiece(const std::u8string& str)
: ptr_(reinterpret_cast<const char*>(str.data())),
length_(static_cast<int32_t>(str.size())) { }
#endif
-#endif // U_HIDE_DRAFT_API
/**
* Constructs from some other implementation of a string piece class, from any
@@ -152,18 +148,16 @@
* @stable ICU 4.2
*/
StringPiece(const char* offset, int32_t len) : ptr_(offset), length_(len) { }
-#ifndef U_HIDE_DRAFT_API
#if defined(__cpp_char8_t) || defined(U_IN_DOXYGEN)
/**
* Constructs from a const char8_t * pointer and a specified length.
* @param str a const char8_t * pointer (need not be terminated)
* @param len the length of the string; must be non-negative
- * @draft ICU 67
+ * @stable ICU 67
*/
StringPiece(const char8_t* str, int32_t len) :
StringPiece(reinterpret_cast<const char*>(str), len) {}
#endif
-#endif // U_HIDE_DRAFT_API
/**
* Substring of another StringPiece.
@@ -233,13 +227,12 @@
*/
void set(const char* str);
-#ifndef U_HIDE_DRAFT_API
#if defined(__cpp_char8_t) || defined(U_IN_DOXYGEN)
/**
* Resets the stringpiece to refer to new data.
* @param xdata pointer the new string data. Need not be NUL-terminated.
* @param len the length of the new data
- * @draft ICU 67
+ * @stable ICU 67
*/
inline void set(const char8_t* xdata, int32_t len) {
set(reinterpret_cast<const char*>(xdata), len);
@@ -248,13 +241,12 @@
/**
* Resets the stringpiece to refer to new data.
* @param str a pointer to a NUL-terminated string.
- * @draft ICU 67
+ * @stable ICU 67
*/
inline void set(const char8_t* str) {
set(reinterpret_cast<const char*>(str));
}
#endif
-#endif // U_HIDE_DRAFT_API
/**
* Removes the first n string units.
@@ -286,13 +278,12 @@
}
}
-#ifndef U_HIDE_DRAFT_API
/**
* Searches the StringPiece for the given search string (needle);
* @param needle The string for which to search.
* @param offset Where to start searching within this string (haystack).
* @return The offset of needle in haystack, or -1 if not found.
- * @draft ICU 67
+ * @stable ICU 67
*/
int32_t find(StringPiece needle, int32_t offset);
@@ -301,10 +292,9 @@
* similar to std::string::compare().
* @param other The string to compare to.
* @return below zero if this < other; above zero if this > other; 0 if this == other.
- * @draft ICU 67
+ * @stable ICU 67
*/
int32_t compare(StringPiece other);
-#endif // U_HIDE_DRAFT_API
/**
* Maximum integer, used as a default value for substring methods.
diff --git a/icu4c/source/common/unicode/utrace.h b/icu4c/source/common/unicode/utrace.h
index 28c313c..677486f 100644
--- a/icu4c/source/common/unicode/utrace.h
+++ b/icu4c/source/common/unicode/utrace.h
@@ -173,24 +173,23 @@
UTRACE_RES_DATA_LIMIT,
#endif // U_HIDE_INTERNAL_API
-#ifndef U_HIDE_DRAFT_API
/**
* The lowest break iterator location.
- * @draft ICU 67
+ * @stable ICU 67
*/
UTRACE_UBRK_START=0x4000,
/**
* Indicates that a character instance of break iterator was created.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UTRACE_UBRK_CREATE_CHARACTER = UTRACE_UBRK_START,
/**
* Indicates that a word instance of break iterator was created.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UTRACE_UBRK_CREATE_WORD,
@@ -200,21 +199,21 @@
* Provides one C-style string to UTraceData: the lb value ("",
* "loose", "strict", or "normal").
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UTRACE_UBRK_CREATE_LINE,
/**
* Indicates that a sentence instance of break iterator was created.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UTRACE_UBRK_CREATE_SENTENCE,
/**
* Indicates that a title instance of break iterator was created.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UTRACE_UBRK_CREATE_TITLE,
@@ -224,12 +223,10 @@
* Provides one C-style string to UTraceData: the script code of what
* the break engine cover ("Hani", "Khmr", "Laoo", "Mymr", or "Thai").
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UTRACE_UBRK_CREATE_BREAK_ENGINE,
-#endif // U_HIDE_DRAFT_API
-
#ifndef U_HIDE_INTERNAL_API
/**
* One more than the highest normal break iterator trace location.
diff --git a/icu4c/source/i18n/unicode/dtptngen.h b/icu4c/source/i18n/unicode/dtptngen.h
index 828c0a9..7ce1ba2 100644
--- a/icu4c/source/i18n/unicode/dtptngen.h
+++ b/icu4c/source/i18n/unicode/dtptngen.h
@@ -492,7 +492,6 @@
#if !UCONFIG_NO_FORMATTING
-#ifndef U_HIDE_DRAFT_API
/**
* Get the default hour cycle for a locale. Uses the locale that the
* DateTimePatternGenerator was initially created with.
@@ -503,10 +502,9 @@
* which must not indicate a failure before the function call.
* Set to U_UNSUPPORTED_ERROR if used on an empty instance.
* @return the default hour cycle.
- * @draft ICU 67
+ * @stable ICU 67
*/
UDateFormatHourCycle getDefaultHourCycle(UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
#endif /* #if !UCONFIG_NO_FORMATTING */
diff --git a/icu4c/source/i18n/unicode/measunit.h b/icu4c/source/i18n/unicode/measunit.h
index ead3dee..36a95b7 100644
--- a/icu4c/source/i18n/unicode/measunit.h
+++ b/icu4c/source/i18n/unicode/measunit.h
@@ -38,7 +38,6 @@
}
} // namespace number
-#ifndef U_HIDE_DRAFT_API
/**
* Enumeration for unit complexity. There are three levels:
*
@@ -52,31 +51,33 @@
* The complexity determines which operations are available. For example, you cannot set the power
* or prefix of a compound unit.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
enum UMeasureUnitComplexity {
/**
* A single unit, like kilojoule.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UMEASURE_UNIT_SINGLE,
/**
* A compound unit, like meter-per-second.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UMEASURE_UNIT_COMPOUND,
/**
* A mixed unit, like hour+minute.
*
- * @draft ICU 67
+ * @stable ICU 67
*/
UMEASURE_UNIT_MIXED
};
+
+#ifndef U_HIDE_DRAFT_API
/**
* Enumeration for SI and binary prefixes, e.g. "kilo-", "nano-", "mebi-".
*
@@ -373,10 +374,9 @@
*/
MeasureUnit(const MeasureUnit &other);
-#ifndef U_HIDE_DRAFT_API
/**
* Move constructor.
- * @draft ICU 67
+ * @stable ICU 67
*/
MeasureUnit(MeasureUnit &&other) noexcept;
@@ -391,10 +391,9 @@
*
* @param identifier The CLDR Unit Identifier.
* @param status Set if the identifier is invalid.
- * @draft ICU 67
+ * @stable ICU 67
*/
static MeasureUnit forIdentifier(StringPiece identifier, UErrorCode& status);
-#endif // U_HIDE_DRAFT_API
/**
* Copy assignment operator.
@@ -402,13 +401,11 @@
*/
MeasureUnit &operator=(const MeasureUnit &other);
-#ifndef U_HIDE_DRAFT_API
/**
* Move assignment operator.
- * @draft ICU 67
+ * @stable ICU 67
*/
MeasureUnit &operator=(MeasureUnit &&other) noexcept;
-#endif // U_HIDE_DRAFT_API
/**
* Returns a polymorphic clone of this object. The result will
@@ -457,12 +454,11 @@
*/
const char *getSubtype() const;
-#ifndef U_HIDE_DRAFT_API
/**
* Get CLDR Unit Identifier for this MeasureUnit, as defined in UTS 35.
*
* @return The string form of this unit, owned by this MeasureUnit.
- * @draft ICU 67
+ * @stable ICU 67
*/
const char* getIdentifier() const;
@@ -471,10 +467,11 @@
*
* @param status Set if an error occurs.
* @return The unit complexity.
- * @draft ICU 67
+ * @stable ICU 67
*/
UMeasureUnitComplexity getComplexity(UErrorCode& status) const;
+#ifndef U_HIDE_DRAFT_API
/**
* Creates a MeasureUnit which is this SINGLE unit augmented with the specified prefix.
* For example, UMEASURE_PREFIX_KILO for "kilo", or UMEASURE_PREFIX_KIBI for "kibi".
@@ -506,6 +503,7 @@
* @draft ICU 69
*/
UMeasurePrefix getPrefix(UErrorCode& status) const;
+#endif // U_HIDE_DRAFT_API
/**
* Creates a MeasureUnit which is this SINGLE unit augmented with the specified dimensionality
@@ -519,7 +517,7 @@
* @param dimensionality The dimensionality (power).
* @param status Set if this is not a SINGLE unit or if another error occurs.
* @return A new SINGLE unit.
- * @draft ICU 67
+ * @stable ICU 67
*/
MeasureUnit withDimensionality(int32_t dimensionality, UErrorCode& status) const;
@@ -534,7 +532,7 @@
*
* @param status Set if this is not a SINGLE unit or if another error occurs.
* @return The dimensionality (power) of this simple unit.
- * @draft ICU 67
+ * @stable ICU 67
*/
int32_t getDimensionality(UErrorCode& status) const;
@@ -548,7 +546,7 @@
*
* @param status Set if this is a MIXED unit or if another error occurs.
* @return The reciprocal of the target unit.
- * @draft ICU 67
+ * @stable ICU 67
*/
MeasureUnit reciprocal(UErrorCode& status) const;
@@ -567,10 +565,9 @@
* @param other The MeasureUnit to multiply with the target.
* @param status Set if this or other is a MIXED unit or if another error occurs.
* @return The product of the target unit with the provided unit.
- * @draft ICU 67
+ * @stable ICU 67
*/
MeasureUnit product(const MeasureUnit& other, UErrorCode& status) const;
-#endif // U_HIDE_DRAFT_API
#ifndef U_HIDE_DRAFT_API
/**
diff --git a/icu4c/source/i18n/unicode/udat.h b/icu4c/source/i18n/unicode/udat.h
index ec25eba..2963e55 100644
--- a/icu4c/source/i18n/unicode/udat.h
+++ b/icu4c/source/i18n/unicode/udat.h
@@ -976,37 +976,35 @@
U_CAPI void U_EXPORT2
udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status);
-#ifndef U_HIDE_DRAFT_API
/**
* Hour Cycle.
- * @draft ICU 67
+ * @stable ICU 67
*/
typedef enum UDateFormatHourCycle {
/**
* Hour in am/pm (0~11)
- * @draft ICU 67
+ * @stable ICU 67
*/
UDAT_HOUR_CYCLE_11,
/**
* Hour in am/pm (1~12)
- * @draft ICU 67
+ * @stable ICU 67
*/
UDAT_HOUR_CYCLE_12,
/**
* Hour in day (0~23)
- * @draft ICU 67
+ * @stable ICU 67
*/
UDAT_HOUR_CYCLE_23,
/**
* Hour in day (1~24)
- * @draft ICU 67
+ * @stable ICU 67
*/
UDAT_HOUR_CYCLE_24
} UDateFormatHourCycle;
-#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
diff --git a/icu4c/source/i18n/unicode/udateintervalformat.h b/icu4c/source/i18n/unicode/udateintervalformat.h
index b100ea6..a8461f3 100644
--- a/icu4c/source/i18n/unicode/udateintervalformat.h
+++ b/icu4c/source/i18n/unicode/udateintervalformat.h
@@ -252,7 +252,6 @@
UErrorCode* status);
-#ifndef U_HIDE_DRAFT_API
/**
* Formats a date/time range using the conventions established for the
* UDateIntervalFormat object.
@@ -267,7 +266,7 @@
* formatting operation.
* @param status
* A pointer to a UErrorCode to receive any errors.
- * @draft ICU 67
+ * @stable ICU 67
*/
U_CAPI void U_EXPORT2
udtitvfmt_formatToResult(
@@ -291,7 +290,7 @@
* formatting operation.
* @param status
* A pointer to a UErrorCode to receive any errors.
- * @draft ICU 67
+ * @stable ICU 67
*/
U_CAPI void U_EXPORT2
@@ -301,7 +300,6 @@
UCalendar* toCalendar,
UFormattedDateInterval* result,
UErrorCode* status);
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
diff --git a/icu4c/source/i18n/unicode/udatpg.h b/icu4c/source/i18n/unicode/udatpg.h
index 5e44cd8..4ff5e83 100644
--- a/icu4c/source/i18n/unicode/udatpg.h
+++ b/icu4c/source/i18n/unicode/udatpg.h
@@ -657,7 +657,6 @@
#if !UCONFIG_NO_FORMATTING
-#ifndef U_HIDE_DRAFT_API
/**
* Return the default hour cycle for a locale. Uses the locale that the
* UDateTimePatternGenerator was initially created with.
@@ -669,11 +668,10 @@
* failure before the function call. Set to U_UNSUPPORTED_ERROR
* if used on an empty instance.
* @return the default hour cycle.
- * @draft ICU 67
+ * @stable ICU 67
*/
U_CAPI UDateFormatHourCycle U_EXPORT2
udatpg_getDefaultHourCycle(const UDateTimePatternGenerator *dtpg, UErrorCode* pErrorCode);
-#endif /* U_HIDE_DRAFT_API */
#endif /* #if !UCONFIG_NO_FORMATTING */