X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/57a6839dcb3bba09e8228b822b290604668416fe..38fbf2fd31f5cd99b500914d6037b1d06b608645:/icuSources/i18n/unicode/uformattable.h diff --git a/icuSources/i18n/unicode/uformattable.h b/icuSources/i18n/unicode/uformattable.h index 36c25766..15830a14 100644 --- a/icuSources/i18n/unicode/uformattable.h +++ b/icuSources/i18n/unicode/uformattable.h @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** -* Copyright (C) 2013, International Business Machines Corporation and others. +* Copyright (C) 2013-2014, International Business Machines Corporation and others. * All Rights Reserved. ******************************************************************************** * @@ -32,8 +34,6 @@ #if !UCONFIG_NO_FORMATTING -#ifndef U_HIDE_DRAFT_API - #include "unicode/localpointer.h" /** @@ -41,7 +41,7 @@ * Practically, this indicates which of the getters would return without conversion * or error. * @see icu::Formattable::Type - * @draft ICU 52 + * @stable ICU 52 */ typedef enum UFormattableType { UFMT_DATE = 0, /**< ufmt_getDate() will return without conversion. @see ufmt_getDate*/ @@ -51,7 +51,13 @@ typedef enum UFormattableType { UFMT_ARRAY, /**< ufmt_countArray() and ufmt_getArray() will return the value. @see ufmt_getArrayItemByIndex */ UFMT_INT64, /**< ufmt_getInt64() will return without conversion. @see ufmt_getInt64 */ UFMT_OBJECT, /**< ufmt_getObject() will return without conversion. @see ufmt_getObject*/ - UFMT_COUNT /**< Count of defined UFormattableType values */ +#ifndef U_HIDE_DEPRECATED_API + /** + * One more than the highest normal UFormattableType value. + * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. + */ + UFMT_COUNT +#endif /* U_HIDE_DEPRECATED_API */ } UFormattableType; @@ -59,7 +65,7 @@ typedef enum UFormattableType { * Opaque type representing various types of data which may be used for formatting * and parsing operations. * @see icu::Formattable - * @draft ICU 52 + * @stable ICU 52 */ typedef void *UFormattable; @@ -68,21 +74,21 @@ typedef void *UFormattable; * may return error if memory allocation failed. * parameter status error code. * See {@link unum_parseToUFormattable} for example code. - * @draft ICU 52 + * @stable ICU 52 * @return the new UFormattable * @see ufmt_close * @see icu::Formattable::Formattable() */ -U_DRAFT UFormattable* U_EXPORT2 +U_STABLE UFormattable* U_EXPORT2 ufmt_open(UErrorCode* status); /** * Cleanup any additional memory allocated by this UFormattable. * @param fmt the formatter - * @draft ICU 52 + * @stable ICU 52 * @see ufmt_open */ -U_DRAFT void U_EXPORT2 +U_STABLE void U_EXPORT2 ufmt_close(UFormattable* fmt); #if U_SHOW_CPLUSPLUS_API @@ -96,13 +102,13 @@ U_NAMESPACE_BEGIN * * @see LocalPointerBase * @see LocalPointer - * @draft ICU 52 + * @stable ICU 52 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattablePointer, UFormattable, ufmt_close); U_NAMESPACE_END -#endif +#endif // U_SHOW_CPLUSPLUS_API /** * Return the type of this object @@ -112,9 +118,9 @@ U_NAMESPACE_END * @return the value as a UFormattableType * @see ufmt_isNumeric * @see icu::Formattable::getType() const - * @draft ICU 52 + * @stable ICU 52 */ -U_DRAFT UFormattableType U_EXPORT2 +U_STABLE UFormattableType U_EXPORT2 ufmt_getType(const UFormattable* fmt, UErrorCode *status); /** @@ -123,9 +129,9 @@ ufmt_getType(const UFormattable* fmt, UErrorCode *status); * @return true if the object is a double, long, or int64 value, else false. * @see ufmt_getType * @see icu::Formattable::isNumeric() const - * @draft ICU 52 + * @stable ICU 52 */ -U_DRAFT UBool U_EXPORT2 +U_STABLE UBool U_EXPORT2 ufmt_isNumeric(const UFormattable* fmt); /** @@ -135,10 +141,10 @@ ufmt_isNumeric(const UFormattable* fmt); * @param fmt the UFormattable object * @param status the error code - any conversion or format errors * @return the value - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getDate(UErrorCode&) const */ -U_DRAFT UDate U_EXPORT2 +U_STABLE UDate U_EXPORT2 ufmt_getDate(const UFormattable* fmt, UErrorCode *status); /** @@ -153,10 +159,10 @@ ufmt_getDate(const UFormattable* fmt, UErrorCode *status); * @param fmt the UFormattable object * @param status the error code - any conversion or format errors * @return the value - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getDouble(UErrorCode&) const */ -U_DRAFT double U_EXPORT2 +U_STABLE double U_EXPORT2 ufmt_getDouble(UFormattable* fmt, UErrorCode *status); /** @@ -174,10 +180,10 @@ ufmt_getDouble(UFormattable* fmt, UErrorCode *status); * @param fmt the UFormattable object * @param status the error code - any conversion or format errors * @return the value - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getLong(UErrorCode&) const */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ufmt_getLong(UFormattable* fmt, UErrorCode *status); @@ -195,10 +201,10 @@ ufmt_getLong(UFormattable* fmt, UErrorCode *status); * @param fmt the UFormattable object * @param status the error code - any conversion or format errors * @return the value - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getInt64(UErrorCode&) const */ -U_DRAFT int64_t U_EXPORT2 +U_STABLE int64_t U_EXPORT2 ufmt_getInt64(UFormattable* fmt, UErrorCode *status); /** @@ -208,10 +214,10 @@ ufmt_getInt64(UFormattable* fmt, UErrorCode *status); * @param fmt the UFormattable object * @param status the error code - any conversion or format errors * @return the value as a const void*. It is a polymorphic C++ object. - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getObject() const */ -U_DRAFT const void *U_EXPORT2 +U_STABLE const void *U_EXPORT2 ufmt_getObject(const UFormattable* fmt, UErrorCode *status); /** @@ -223,10 +229,10 @@ ufmt_getObject(const UFormattable* fmt, UErrorCode *status); * @param status the error code - any conversion or format errors * @param len if non null, contains the string length on return * @return the null terminated string value - must not be referenced after any other functions are called on this UFormattable. - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getString(UnicodeString&)const */ -U_DRAFT const UChar* U_EXPORT2 +U_STABLE const UChar* U_EXPORT2 ufmt_getUChars(UFormattable* fmt, int32_t *len, UErrorCode *status); /** @@ -234,10 +240,10 @@ ufmt_getUChars(UFormattable* fmt, int32_t *len, UErrorCode *status); * @param fmt the UFormattable object * @param status the error code - any conversion or format errors. U_ILLEGAL_ARGUMENT_ERROR if not an array type. * @return the number of array objects or undefined if not an array type - * @draft ICU 52 + * @stable ICU 52 * @see ufmt_getArrayItemByIndex */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ufmt_getArrayLength(const UFormattable* fmt, UErrorCode *status); /** @@ -246,10 +252,10 @@ ufmt_getArrayLength(const UFormattable* fmt, UErrorCode *status); * @param n the number of the array to return (0 based). * @param status the error code - any conversion or format errors. Returns an error if n is out of bounds. * @return the nth array value, only valid while the containing UFormattable is valid. NULL if not an array. - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getArray(int32_t&, UErrorCode&) const */ -U_DRAFT UFormattable * U_EXPORT2 +U_STABLE UFormattable * U_EXPORT2 ufmt_getArrayItemByIndex(UFormattable* fmt, int32_t n, UErrorCode *status); /** @@ -271,12 +277,11 @@ ufmt_getArrayItemByIndex(UFormattable* fmt, int32_t n, UErrorCode *status); * @param len if non-null, on exit contains the string length (not including the terminating null) * @param status the error code * @return the character buffer as a NULL terminated string, which is owned by the object and must not be accessed if any other functions are called on this object. - * @draft ICU 52 + * @stable ICU 52 * @see icu::Formattable::getDecimalNumber(UErrorCode&) */ -U_DRAFT const char * U_EXPORT2 +U_STABLE const char * U_EXPORT2 ufmt_getDecNumChars(UFormattable *fmt, int32_t *len, UErrorCode *status); -#endif /* U_HIDE_DRAFT_API */ #endif