*/
static inline Formattable *fromUFormattable(UFormattable *fmt);
+ /**
+ * Convert the UFormattable to a Formattable. Internally, this is a reinterpret_cast.
+ * @param fmt a valid UFormattable
+ * @return the UFormattable as a Formattable object pointer. This is an alias to the original
+ * UFormattable, and so is only valid while the original argument remains in scope.
+ * @draft ICU 52
+ */
+ static inline const Formattable *fromUFormattable(const UFormattable *fmt);
+
/**
* Convert this object pointer to a UFormattable.
* @return this object as a UFormattable pointer. This is an alias to the original UFormattable,
return reinterpret_cast<Formattable *>(fmt);
}
+inline const Formattable* Formattable::fromUFormattable(const UFormattable *fmt) {
+ return reinterpret_cast<const Formattable *>(fmt);
+}
+
U_NAMESPACE_END
-/*
-TODO
-* copy C++ apidoc concerning error codes to appropriate wrapper functions
-*/
-
-
/*
********************************************************************************
* Copyright (C) 2013, International Business Machines Corporation and others.
* Modification History:
*
* Date Name Description
-* 2013 Jul 7 srl New
+* 2013 Jun 7 srl New
********************************************************************************
*/
#endif
-#ifndef U_HIDE_INTERNAL_API
/**
* Return the type of this object
* @param fmt the UFormattable object
* @status status code - U_ILLEGAL_ARGUMENT_ERROR is returned if the UFormattable contains data not supported by
* the API
* @return the value as a UFormattableType
- * @internal
+ * @draft ICU 52
*/
-U_INTERNAL UFormattableType U_EXPORT2
+U_DRAFT UFormattableType U_EXPORT2
ufmt_getType(UFormattable* fmt, UErrorCode *status);
/**
- * Return the type of this object
+ * Return whether the object is numeric.
* @param fmt the UFormattable object
* @return true if the object is a double, long, or int64 value.
- * @internal
+ * @draft ICU 52
*/
-U_INTERNAL UBool U_EXPORT2
+U_DRAFT UBool U_EXPORT2
ufmt_isNumeric(UFormattable* fmt);
-#endif
/**
* Get the value as a date, converting if need be.
UFieldPosition* pos, /* ignored if 0 */
UErrorCode* status);
-#ifndef U_HIDE_INTERNAL_API
/**
* Format a UFormattable into a string
- * @internal
+ * @draft ICU 52
*/
-U_INTERNAL int32_t U_EXPORT2
+U_DRAFT int32_t U_EXPORT2
unum_formatUFormattable(const UNumberFormat* fmt,
- UFormattable *number,
+ const UFormattable *number,
UChar *result,
int32_t resultLength,
UFieldPosition *pos, /* ignored if 0 */
UErrorCode *status);
-#endif
/**
* Parse a string into an integer using a UNumberFormat.
UChar* currency,
UErrorCode* status);
-#ifndef U_HIDE_INTERNAL_API
/**
* Parse into a UFormattable.
* @param result - result formattable. Will be allocated with ufmt_open() first if NULL is passed in.
- * @internal
+ * @draft ICU 52
*/
-U_INTERNAL UFormattable* U_EXPORT2
+U_DRAFT UFormattable* U_EXPORT2
unum_parseToUFormattable(const UNumberFormat* fmt,
UFormattable *result,
const UChar* text,
int32_t textLength,
int32_t* parsePos, /* 0 = start */
UErrorCode* status);
-#endif
/**
* Set the pattern used by a UNumberFormat. This can only be used
U_INTERNAL int32_t U_EXPORT2
unum_formatUFormattable(const UNumberFormat* fmt,
- UFormattable *number,
+ const UFormattable *number,
UChar *result,
int32_t resultLength,
UFieldPosition *pos, /* ignored if 0 */