1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (c) 2004-2014, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
9 * Created: April 26, 2004
11 **********************************************************************
13 #ifndef __CURRENCYUNIT_H__
14 #define __CURRENCYUNIT_H__
16 #include "unicode/utypes.h"
18 #if !UCONFIG_NO_FORMATTING
20 #include "unicode/measunit.h"
24 * \brief C++ API: Currency Unit Information.
30 * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
31 * yen). This class is a thin wrapper over a UChar string that
32 * subclasses MeasureUnit, for use with Measure and MeasureFormat.
37 class U_I18N_API CurrencyUnit: public MeasureUnit {
40 * Construct an object with the given ISO currency code.
41 * @param isoCode the 3-letter ISO 4217 currency code; must not be
42 * NULL and must have length 3
43 * @param ec input-output error code. If the isoCode is invalid,
44 * then this will be set to a failing value.
47 CurrencyUnit(const UChar* isoCode, UErrorCode &ec);
53 CurrencyUnit(const CurrencyUnit& other);
59 CurrencyUnit& operator=(const CurrencyUnit& other);
62 * Return a polymorphic clone of this object. The result will
63 * have the same class as returned by getDynamicClassID().
66 virtual UObject* clone() const;
72 virtual ~CurrencyUnit();
75 * Returns a unique class ID for this object POLYMORPHICALLY.
76 * This method implements a simple form of RTTI used by ICU.
77 * @return The class ID for this object. All objects of a given
78 * class have the same class ID. Objects of other classes have
79 * different class IDs.
82 virtual UClassID getDynamicClassID() const;
85 * Returns the class ID for this class. This is used to compare to
86 * the return value of getDynamicClassID().
87 * @return The class ID for all objects of this class.
90 static UClassID U_EXPORT2 getStaticClassID();
93 * Return the ISO currency code of this object.
96 inline const UChar* getISOCurrency() const;
100 * The ISO 4217 code of this object.
105 inline const UChar* CurrencyUnit::getISOCurrency() const {
111 #endif // !UCONFIG_NO_FORMATTING
112 #endif // __CURRENCYUNIT_H__