ICU 62.1 62.1
|
A unit of currency, such as USD (U.S. More...
#include <currunit.h>
Public Member Functions | |
CurrencyUnit () | |
Default constructor. | |
CurrencyUnit (ConstChar16Ptr isoCode, UErrorCode &ec) | |
Construct an object with the given ISO currency code. | |
CurrencyUnit (const CurrencyUnit &other) | |
Copy constructor. | |
CurrencyUnit (const MeasureUnit &measureUnit, UErrorCode &ec) | |
Copy constructor from MeasureUnit. | |
CurrencyUnit & | operator= (const CurrencyUnit &other) |
Assignment operator. | |
virtual UObject * | clone () const |
Return a polymorphic clone of this object. | |
virtual | ~CurrencyUnit () |
Destructor. | |
virtual UClassID | getDynamicClassID () const |
Returns a unique class ID for this object POLYMORPHICALLY. | |
const char16_t * | getISOCurrency () const |
Return the ISO currency code of this object. | |
![]() | |
MeasureUnit () | |
Default constructor. | |
MeasureUnit (const MeasureUnit &other) | |
Copy constructor. | |
MeasureUnit & | operator= (const MeasureUnit &other) |
Assignment operator. | |
virtual | ~MeasureUnit () |
Destructor. | |
virtual UBool | operator== (const UObject &other) const |
Equality operator. | |
UBool | operator!= (const UObject &other) const |
Inequality operator. | |
const char * | getType () const |
Get the type. | |
const char * | getSubtype () const |
Get the sub type. | |
int32_t | getIndex () const |
ICU use only. | |
![]() | |
virtual | ~UObject () |
Destructor. | |
Additional Inherited Members | |
![]() | |
void | initTime (const char *timeId) |
For ICU use only. | |
void | initCurrency (const char *isoCurrency) |
For ICU use only. | |
void | initNoUnit (const char *subtype) |
For ICU use only. | |
A unit of currency, such as USD (U.S.
dollars) or JPY (Japanese yen). This class is a thin wrapper over a char16_t string that subclasses MeasureUnit, for use with Measure and MeasureFormat.
Definition at line 37 of file currunit.h.
icu::CurrencyUnit::CurrencyUnit | ( | ) |
Default constructor.
Initializes currency code to "XXX" (no currency).
icu::CurrencyUnit::CurrencyUnit | ( | ConstChar16Ptr | isoCode, |
UErrorCode & | ec ) |
Construct an object with the given ISO currency code.
isoCode | the 3-letter ISO 4217 currency code; must have length 3 and need not be NUL-terminated. If NULL, the currency is initialized to the unknown currency XXX. |
ec | input-output error code. If the isoCode is invalid, then this will be set to a failing value. |
icu::CurrencyUnit::CurrencyUnit | ( | const CurrencyUnit & | other | ) |
Copy constructor.
icu::CurrencyUnit::CurrencyUnit | ( | const MeasureUnit & | measureUnit, |
UErrorCode & | ec ) |
Copy constructor from MeasureUnit.
This constructor allows you to restore a CurrencyUnit that was sliced to MeasureUnit.
measureUnit | The MeasureUnit to copy from. |
ec | Set to a failing value if the MeasureUnit is not a currency. |
Return a polymorphic clone of this object.
The result will have the same class as returned by getDynamicClassID().
Reimplemented from icu::MeasureUnit.
Returns a unique class ID for this object POLYMORPHICALLY.
This method implements a simple form of RTTI used by ICU.
Reimplemented from icu::MeasureUnit.
Return the ISO currency code of this object.
Definition at line 124 of file currunit.h.
Returns the class ID for this class.
This is used to compare to the return value of getDynamicClassID().
CurrencyUnit & icu::CurrencyUnit::operator= | ( | const CurrencyUnit & | other | ) |
Assignment operator.