ICU-21480 Promoted all @draft ICU 67 APIs to @stable ICU 67.

This commit is contained in:
Rich Gillam 2021-02-12 18:39:27 -08:00
parent 1bf2aa2354
commit be039c5936
10 changed files with 48 additions and 82 deletions

View file

@ -71,7 +71,6 @@ public:
*/
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 @@ public:
*
* @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 @@ public:
*
* @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

View file

@ -91,8 +91,6 @@ enum ULocMatchDemotion {
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 @@ typedef enum ULocMatchDemotion ULocMatchDemotion;
* 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 BretonFrench. (default)
*
* @draft ICU 67
* @stable ICU 67
*/
ULOCMATCH_DIRECTION_WITH_ONE_WAY,
/**
* Locale matching limited to two-way matches including e.g. DanishNorwegian
* but ignoring one-way matches.
*
* @draft ICU 67
* @stable ICU 67
*/
ULOCMATCH_DIRECTION_ONLY_TWO_WAY
};
@ -129,8 +127,6 @@ enum ULocMatchDirection {
typedef enum ULocMatchDirection ULocMatchDirection;
#endif
#endif // U_FORCE_HIDE_DRAFT_API
struct UHashtable;
U_NAMESPACE_BEGIN
@ -463,14 +459,13 @@ public:
*/
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 @@ public:
}
return *this;
}
#endif // U_HIDE_DRAFT_API
#ifndef U_HIDE_DRAFT_API
/**

View file

@ -571,15 +571,13 @@ public:
*/
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.

View file

@ -75,12 +75,11 @@ class U_COMMON_API StringPiece : public UMemory {
* @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 @@ class U_COMMON_API StringPiece : public UMemory {
* 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 @@ class U_COMMON_API StringPiece : public UMemory {
*/
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 @@ class U_COMMON_API StringPiece : public UMemory {
* @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 @@ class U_COMMON_API StringPiece : public UMemory {
*/
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 @@ class U_COMMON_API StringPiece : public UMemory {
/**
* 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 @@ class U_COMMON_API StringPiece : public UMemory {
}
}
#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 @@ class U_COMMON_API StringPiece : public UMemory {
* 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.

View file

@ -173,24 +173,23 @@ typedef enum UTraceFunctionNumber {
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 @@ typedef enum UTraceFunctionNumber {
* 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 @@ typedef enum UTraceFunctionNumber {
* 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.

View file

@ -492,7 +492,6 @@ public:
#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 @@ public:
* 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 */

View file

@ -38,7 +38,6 @@ class LongNameHandler;
}
} // namespace number
#ifndef U_HIDE_DRAFT_API
/**
* Enumeration for unit complexity. There are three levels:
*
@ -52,31 +51,33 @@ class LongNameHandler;
* 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 @@ class U_I18N_API MeasureUnit: public UObject {
*/
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 @@ class U_I18N_API MeasureUnit: public UObject {
*
* @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 @@ class U_I18N_API MeasureUnit: public UObject {
*/
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 @@ class U_I18N_API MeasureUnit: public UObject {
*/
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 @@ class U_I18N_API MeasureUnit: public UObject {
*
* @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 @@ class U_I18N_API MeasureUnit: public UObject {
* @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 @@ class U_I18N_API MeasureUnit: public UObject {
* @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 @@ class U_I18N_API MeasureUnit: public UObject {
*
* @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 @@ class U_I18N_API MeasureUnit: public UObject {
*
* @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 @@ class U_I18N_API MeasureUnit: public UObject {
* @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
/**

View file

@ -976,37 +976,35 @@ udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute att
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

View file

@ -252,7 +252,6 @@ udtitvfmt_format(const UDateIntervalFormat* formatter,
UErrorCode* status);
#ifndef U_HIDE_DRAFT_API
/**
* Formats a date/time range using the conventions established for the
* UDateIntervalFormat object.
@ -267,7 +266,7 @@ udtitvfmt_format(const UDateIntervalFormat* formatter,
* 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 @@ udtitvfmt_formatToResult(
* 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 @@ udtitvfmt_formatCalendarToResult(
UCalendar* toCalendar,
UFormattedDateInterval* result,
UErrorCode* status);
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**

View file

@ -657,7 +657,6 @@ udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
#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 @@ udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
* 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 */