]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unicode/currunit.h
1 // © 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.
27 #if U_SHOW_CPLUSPLUS_API
31 * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
32 * yen). This class is a thin wrapper over a char16_t string that
33 * subclasses MeasureUnit, for use with Measure and MeasureFormat.
38 class U_I18N_API CurrencyUnit
: public MeasureUnit
{
41 * Construct an object with the given ISO currency code.
42 * @param isoCode the 3-letter ISO 4217 currency code; must not be
43 * NULL and must have length 3
44 * @param ec input-output error code. If the isoCode is invalid,
45 * then this will be set to a failing value.
48 CurrencyUnit(ConstChar16Ptr isoCode
, UErrorCode
&ec
);
54 CurrencyUnit(const CurrencyUnit
& other
);
60 CurrencyUnit
& operator=(const CurrencyUnit
& other
);
63 * Return a polymorphic clone of this object. The result will
64 * have the same class as returned by getDynamicClassID().
67 virtual UObject
* clone() const;
73 virtual ~CurrencyUnit();
76 * Returns a unique class ID for this object POLYMORPHICALLY.
77 * This method implements a simple form of RTTI used by ICU.
78 * @return The class ID for this object. All objects of a given
79 * class have the same class ID. Objects of other classes have
80 * different class IDs.
83 virtual UClassID
getDynamicClassID() const;
86 * Returns the class ID for this class. This is used to compare to
87 * the return value of getDynamicClassID().
88 * @return The class ID for all objects of this class.
91 static UClassID U_EXPORT2
getStaticClassID();
94 * Return the ISO currency code of this object.
97 inline const char16_t* getISOCurrency() const;
101 * The ISO 4217 code of this object.
106 inline const char16_t* CurrencyUnit::getISOCurrency() const {
111 #endif // U_SHOW_CPLUSPLUS_API
113 #endif // !UCONFIG_NO_FORMATTING
114 #endif // __CURRENCYUNIT_H__