1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/currfmt.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,101 @@ 1.4 +/* 1.5 +********************************************************************** 1.6 +* Copyright (c) 2004-2010, International Business Machines 1.7 +* Corporation and others. All Rights Reserved. 1.8 +********************************************************************** 1.9 +* Author: Alan Liu 1.10 +* Created: April 20, 2004 1.11 +* Since: ICU 3.0 1.12 +********************************************************************** 1.13 +*/ 1.14 +#ifndef CURRENCYFORMAT_H 1.15 +#define CURRENCYFORMAT_H 1.16 + 1.17 +#include "unicode/utypes.h" 1.18 + 1.19 +#if !UCONFIG_NO_FORMATTING 1.20 + 1.21 +#include "unicode/measfmt.h" 1.22 + 1.23 +U_NAMESPACE_BEGIN 1.24 + 1.25 +class NumberFormat; 1.26 + 1.27 +/** 1.28 + * Temporary internal concrete subclass of MeasureFormat implementing 1.29 + * parsing and formatting of currency amount objects. This class is 1.30 + * likely to be redesigned and rewritten in the near future. 1.31 + * 1.32 + * <p>This class currently delegates to DecimalFormat for parsing and 1.33 + * formatting. 1.34 + * 1.35 + * @see MeasureFormat 1.36 + * @author Alan Liu 1.37 + * @internal 1.38 + */ 1.39 +class CurrencyFormat : public MeasureFormat { 1.40 + 1.41 + public: 1.42 + 1.43 + /** 1.44 + * Construct a CurrencyFormat for the given locale. 1.45 + */ 1.46 + CurrencyFormat(const Locale& locale, UErrorCode& ec); 1.47 + 1.48 + /** 1.49 + * Copy constructor. 1.50 + */ 1.51 + CurrencyFormat(const CurrencyFormat& other); 1.52 + 1.53 + /** 1.54 + * Destructor. 1.55 + */ 1.56 + virtual ~CurrencyFormat(); 1.57 + 1.58 + /** 1.59 + * Override Format API. 1.60 + */ 1.61 + virtual UBool operator==(const Format& other) const; 1.62 + 1.63 + /** 1.64 + * Override Format API. 1.65 + */ 1.66 + virtual Format* clone() const; 1.67 + 1.68 + 1.69 + using MeasureFormat::format; 1.70 + 1.71 + /** 1.72 + * Override Format API. 1.73 + */ 1.74 + virtual UnicodeString& format(const Formattable& obj, 1.75 + UnicodeString& appendTo, 1.76 + FieldPosition& pos, 1.77 + UErrorCode& ec) const; 1.78 + 1.79 + /** 1.80 + * Override Format API. 1.81 + */ 1.82 + virtual void parseObject(const UnicodeString& source, 1.83 + Formattable& result, 1.84 + ParsePosition& pos) const; 1.85 + 1.86 + /** 1.87 + * Override Format API. 1.88 + */ 1.89 + virtual UClassID getDynamicClassID() const; 1.90 + 1.91 + /** 1.92 + * Returns the class ID for this class. 1.93 + */ 1.94 + static UClassID U_EXPORT2 getStaticClassID(); 1.95 + 1.96 + private: 1.97 + 1.98 + NumberFormat* fmt; 1.99 +}; 1.100 + 1.101 +U_NAMESPACE_END 1.102 + 1.103 +#endif // #if !UCONFIG_NO_FORMATTING 1.104 +#endif // #ifndef CURRENCYFORMAT_H