From 96b1bacfb07fd0f5bc1f64ad1393e435b667be5c Mon Sep 17 00:00:00 2001 From: "Shane F. Carr" Date: Fri, 17 Jan 2020 19:27:38 +0100 Subject: [PATCH] Add U_HIDE_DRAFT_API --- icu4c/source/common/unicode/localpointer.h | 19 +++++++++++++++++++ icu4c/source/i18n/unicode/measunit.h | 6 ++++++ 2 files changed, 25 insertions(+) diff --git a/icu4c/source/common/unicode/localpointer.h b/icu4c/source/common/unicode/localpointer.h index b6f8b15c7fb..cf6782a0078 100644 --- a/icu4c/source/common/unicode/localpointer.h +++ b/icu4c/source/common/unicode/localpointer.h @@ -406,9 +406,19 @@ public: src.ptr=nullptr; } +#ifndef U_HIDE_DRAFT_API + /** + * Construct a LocalArray with a specified length. + * + * @param p Pointer to the array to adopt. + * @param length The length of the array. + * @return A LocalArray with a length field. + * @draft ICU 67 + */ static LocalArray withLength(T *p, int32_t length) { return LocalArray(p, length); } +#endif // U_HIDE_DRAFT_API #ifndef U_HIDE_DRAFT_API /** @@ -549,7 +559,16 @@ public: } #endif /* U_HIDE_DRAFT_API */ +#ifndef U_HIDE_DRAFT_API + /** + * The length of the array contained in the LocalArray. The size must be + * provided when the LocalArray is constructed. + * + * @return The length of the array, or -1 if unknown. + * @draft ICU 67 + */ int32_t length() const { return fLength; } +#endif // U_HIDE_DRAFT_API private: int32_t fLength = -1; diff --git a/icu4c/source/i18n/unicode/measunit.h b/icu4c/source/i18n/unicode/measunit.h index 4ec0f62684f..f3bc07fc417 100644 --- a/icu4c/source/i18n/unicode/measunit.h +++ b/icu4c/source/i18n/unicode/measunit.h @@ -31,6 +31,7 @@ U_NAMESPACE_BEGIN class StringEnumeration; +#ifndef U_HIDE_DRAFT_API /** * Enumeration for unit complexity. There are three levels: * @@ -223,6 +224,7 @@ typedef enum UMeasureSIPrefix { */ UMEASURE_SI_PREFIX_YOCTO = -24 } UMeasureSIPrefix; +#endif // U_HIDE_DRAFT_API /** * A unit such as length, mass, volume, currency, etc. A unit is @@ -253,6 +255,7 @@ class U_I18N_API MeasureUnit: public UObject { */ MeasureUnit(MeasureUnit &&other) noexcept; +#ifndef U_HIDE_DRAFT_API /** * Construct a MeasureUnit from a CLDR Sequence Unit Identifier, defined in UTS 35. * Validates and canonicalizes the identifier. @@ -266,6 +269,7 @@ class U_I18N_API MeasureUnit: public UObject { * @draft ICU 67 */ static MeasureUnit forIdentifier(StringPiece identifier, UErrorCode& status); +#endif // U_HIDE_DRAFT_API /** * Copy assignment operator. @@ -326,6 +330,7 @@ class U_I18N_API MeasureUnit: public UObject { */ const char *getSubtype() const; +#ifndef U_HIDE_DRAFT_API /** * Get the CLDR Sequence Unit Identifier for this MeasureUnit, as defined in UTS 35. * @@ -452,6 +457,7 @@ class U_I18N_API MeasureUnit: public UObject { * @return An array of compound units, owned by the caller. */ LocalArray getCompoundUnits(UErrorCode& status) const; +#endif // U_HIDE_DRAFT_API /** * getAvailable gets all of the available units.