Index: source/i18n/unicode/tmutfmt.h |
diff --git a/source/i18n/unicode/tmutfmt.h b/source/i18n/unicode/tmutfmt.h |
index 7ed7035b6b526f19f808b7e0effe7d461e6283c6..728ff13219a012d1c886ee98bb8d8ea183cbd18b 100644 |
--- a/source/i18n/unicode/tmutfmt.h |
+++ b/source/i18n/unicode/tmutfmt.h |
@@ -1,6 +1,6 @@ |
/* |
******************************************************************************* |
- * Copyright (C) 2008-2013, Google, International Business Machines Corporation |
+ * Copyright (C) 2008-2014, Google, International Business Machines Corporation |
* and others. All Rights Reserved. |
******************************************************************************* |
*/ |
@@ -17,6 +17,7 @@ |
#if !UCONFIG_NO_FORMATTING |
+#ifndef U_HIDE_DEPRECATED_API |
#include "unicode/unistr.h" |
#include "unicode/tmunit.h" |
@@ -25,22 +26,24 @@ |
#include "unicode/numfmt.h" |
#include "unicode/plurrule.h" |
+ |
/** |
* Constants for various styles. |
* There are 2 styles: full name and abbreviated name. |
* For example, for English, the full name for hour duration is "3 hours", |
* and the abbreviated name is "3 hrs". |
- * @stable ICU 4.8 |
+ * @deprecated ICU 53 Use MeasureFormat and UMeasureFormatWidth instead. |
*/ |
enum UTimeUnitFormatStyle { |
- /** @stable ICU 4.8 */ |
+ /** @deprecated ICU 53 */ |
UTMUTFMT_FULL_STYLE, |
- /** @stable ICU 4.8 */ |
+ /** @deprecated ICU 53 */ |
UTMUTFMT_ABBREVIATED_STYLE, |
- /** @stable ICU 4.8 */ |
+ /** @deprecated ICU 53 */ |
UTMUTFMT_FORMAT_STYLE_COUNT |
}; |
-typedef enum UTimeUnitFormatStyle UTimeUnitFormatStyle; /**< @stable ICU 4.8 */ |
+typedef enum UTimeUnitFormatStyle UTimeUnitFormatStyle; /**< @deprecated ICU 53 */ |
+ |
U_NAMESPACE_BEGIN |
@@ -75,7 +78,7 @@ class UVector; |
* <P> |
* @see TimeUnitAmount |
* @see TimeUnitFormat |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 Use the MeasureFormat class instead. |
*/ |
class U_I18N_API TimeUnitFormat: public MeasureFormat { |
public: |
@@ -83,31 +86,31 @@ public: |
/** |
* Create TimeUnitFormat with default locale, and full name style. |
* Use setLocale and/or setFormat to modify. |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
TimeUnitFormat(UErrorCode& status); |
/** |
* Create TimeUnitFormat given locale, and full name style. |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
TimeUnitFormat(const Locale& locale, UErrorCode& status); |
/** |
* Create TimeUnitFormat given locale and style. |
- * @stable ICU 4.8 |
+ * @deprecated ICU 53 |
*/ |
TimeUnitFormat(const Locale& locale, UTimeUnitFormatStyle style, UErrorCode& status); |
/** |
* Copy constructor. |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
TimeUnitFormat(const TimeUnitFormat&); |
/** |
* deconstructor |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
virtual ~TimeUnitFormat(); |
@@ -115,32 +118,22 @@ public: |
* Clone this Format object polymorphically. The caller owns the result and |
* should delete it when done. |
* @return A copy of the object. |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
virtual Format* clone(void) const; |
/** |
* Assignment operator |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
TimeUnitFormat& operator=(const TimeUnitFormat& other); |
- |
- /** |
- * Return true if the given Format objects are semantically equal. Objects |
- * of different subclasses are considered unequal. |
- * @param other the object to be compared with. |
- * @return true if the given Format objects are semantically equal. |
- * @stable ICU 4.2 |
- */ |
- virtual UBool operator==(const Format& other) const; |
- |
/** |
* Return true if the given Format objects are not semantically equal. |
* Objects of different subclasses are considered unequal. |
* @param other the object to be compared with. |
* @return true if the given Format objects are not semantically equal. |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
UBool operator!=(const Format& other) const; |
@@ -148,7 +141,7 @@ public: |
* Set the locale used for formatting or parsing. |
* @param locale the locale to be set |
* @param status output param set to success/failure code on exit |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
void setLocale(const Locale& locale, UErrorCode& status); |
@@ -157,30 +150,14 @@ public: |
* Set the number format used for formatting or parsing. |
* @param format the number formatter to be set |
* @param status output param set to success/failure code on exit |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
void setNumberFormat(const NumberFormat& format, UErrorCode& status); |
- |
- using MeasureFormat::format; |
- |
- /** |
- * Format a TimeUnitAmount. |
- * If the formattable object is not a time unit amount object, |
- * or the number in time unit amount is not a double type or long type |
- * numeric, it returns a failing status: U_ILLEGAL_ARGUMENT_ERROR. |
- * @see Format#format(const Formattable&, UnicodeString&, FieldPosition&, UErrorCode&) const |
- * @stable ICU 4.2 |
- */ |
- virtual UnicodeString& format(const Formattable& obj, |
- UnicodeString& toAppendTo, |
- FieldPosition& pos, |
- UErrorCode& status) const; |
- |
/** |
* Parse a TimeUnitAmount. |
* @see Format#parseObject(const UnicodeString&, Formattable&, ParsePosition&) const; |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
virtual void parseObject(const UnicodeString& source, |
Formattable& result, |
@@ -195,7 +172,7 @@ public: |
* . erived::getStaticClassID()) ... |
* </pre> |
* @return The class ID for all objects of this class. |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
static UClassID U_EXPORT2 getStaticClassID(void); |
@@ -208,18 +185,15 @@ public: |
* @return The class ID for this object. All objects of a |
* given class have the same class ID. Objects of |
* other classes have different class IDs. |
- * @stable ICU 4.2 |
+ * @deprecated ICU 53 |
*/ |
virtual UClassID getDynamicClassID(void) const; |
private: |
- NumberFormat* fNumberFormat; |
- Locale fLocale; |
Hashtable* fTimeUnitToCountToPatterns[TimeUnit::UTIMEUNIT_FIELD_COUNT]; |
- PluralRules* fPluralRules; |
UTimeUnitFormatStyle fStyle; |
- void create(const Locale& locale, UTimeUnitFormatStyle style, UErrorCode& status); |
+ void create(UTimeUnitFormatStyle style, UErrorCode& status); |
// it might actually be simpler to make them Decimal Formats later. |
// initialize all private data members |
@@ -255,17 +229,14 @@ private: |
}; |
- |
- |
inline UBool |
TimeUnitFormat::operator!=(const Format& other) const { |
return !operator==(other); |
} |
- |
- |
U_NAMESPACE_END |
+#endif /* U_HIDE_DEPRECATED_API */ |
#endif /* #if !UCONFIG_NO_FORMATTING */ |
#endif // __TMUTFMT_H__ |