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