Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | ********************************************************************** |
michael@0 | 3 | * Copyright (c) 2004-2010, International Business Machines |
michael@0 | 4 | * Corporation and others. All Rights Reserved. |
michael@0 | 5 | ********************************************************************** |
michael@0 | 6 | * Author: Alan Liu |
michael@0 | 7 | * Created: April 20, 2004 |
michael@0 | 8 | * Since: ICU 3.0 |
michael@0 | 9 | ********************************************************************** |
michael@0 | 10 | */ |
michael@0 | 11 | #ifndef CURRENCYFORMAT_H |
michael@0 | 12 | #define CURRENCYFORMAT_H |
michael@0 | 13 | |
michael@0 | 14 | #include "unicode/utypes.h" |
michael@0 | 15 | |
michael@0 | 16 | #if !UCONFIG_NO_FORMATTING |
michael@0 | 17 | |
michael@0 | 18 | #include "unicode/measfmt.h" |
michael@0 | 19 | |
michael@0 | 20 | U_NAMESPACE_BEGIN |
michael@0 | 21 | |
michael@0 | 22 | class NumberFormat; |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * Temporary internal concrete subclass of MeasureFormat implementing |
michael@0 | 26 | * parsing and formatting of currency amount objects. This class is |
michael@0 | 27 | * likely to be redesigned and rewritten in the near future. |
michael@0 | 28 | * |
michael@0 | 29 | * <p>This class currently delegates to DecimalFormat for parsing and |
michael@0 | 30 | * formatting. |
michael@0 | 31 | * |
michael@0 | 32 | * @see MeasureFormat |
michael@0 | 33 | * @author Alan Liu |
michael@0 | 34 | * @internal |
michael@0 | 35 | */ |
michael@0 | 36 | class CurrencyFormat : public MeasureFormat { |
michael@0 | 37 | |
michael@0 | 38 | public: |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * Construct a CurrencyFormat for the given locale. |
michael@0 | 42 | */ |
michael@0 | 43 | CurrencyFormat(const Locale& locale, UErrorCode& ec); |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Copy constructor. |
michael@0 | 47 | */ |
michael@0 | 48 | CurrencyFormat(const CurrencyFormat& other); |
michael@0 | 49 | |
michael@0 | 50 | /** |
michael@0 | 51 | * Destructor. |
michael@0 | 52 | */ |
michael@0 | 53 | virtual ~CurrencyFormat(); |
michael@0 | 54 | |
michael@0 | 55 | /** |
michael@0 | 56 | * Override Format API. |
michael@0 | 57 | */ |
michael@0 | 58 | virtual UBool operator==(const Format& other) const; |
michael@0 | 59 | |
michael@0 | 60 | /** |
michael@0 | 61 | * Override Format API. |
michael@0 | 62 | */ |
michael@0 | 63 | virtual Format* clone() const; |
michael@0 | 64 | |
michael@0 | 65 | |
michael@0 | 66 | using MeasureFormat::format; |
michael@0 | 67 | |
michael@0 | 68 | /** |
michael@0 | 69 | * Override Format API. |
michael@0 | 70 | */ |
michael@0 | 71 | virtual UnicodeString& format(const Formattable& obj, |
michael@0 | 72 | UnicodeString& appendTo, |
michael@0 | 73 | FieldPosition& pos, |
michael@0 | 74 | UErrorCode& ec) const; |
michael@0 | 75 | |
michael@0 | 76 | /** |
michael@0 | 77 | * Override Format API. |
michael@0 | 78 | */ |
michael@0 | 79 | virtual void parseObject(const UnicodeString& source, |
michael@0 | 80 | Formattable& result, |
michael@0 | 81 | ParsePosition& pos) const; |
michael@0 | 82 | |
michael@0 | 83 | /** |
michael@0 | 84 | * Override Format API. |
michael@0 | 85 | */ |
michael@0 | 86 | virtual UClassID getDynamicClassID() const; |
michael@0 | 87 | |
michael@0 | 88 | /** |
michael@0 | 89 | * Returns the class ID for this class. |
michael@0 | 90 | */ |
michael@0 | 91 | static UClassID U_EXPORT2 getStaticClassID(); |
michael@0 | 92 | |
michael@0 | 93 | private: |
michael@0 | 94 | |
michael@0 | 95 | NumberFormat* fmt; |
michael@0 | 96 | }; |
michael@0 | 97 | |
michael@0 | 98 | U_NAMESPACE_END |
michael@0 | 99 | |
michael@0 | 100 | #endif // #if !UCONFIG_NO_FORMATTING |
michael@0 | 101 | #endif // #ifndef CURRENCYFORMAT_H |