michael@0: /* michael@0: ********************************************************************** michael@0: * Copyright (c) 2004-2006, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: ********************************************************************** michael@0: * Author: Alan Liu michael@0: * Created: April 26, 2004 michael@0: * Since: ICU 3.0 michael@0: ********************************************************************** michael@0: */ michael@0: #ifndef __CURRENCYUNIT_H__ michael@0: #define __CURRENCYUNIT_H__ michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_FORMATTING michael@0: michael@0: #include "unicode/measunit.h" michael@0: michael@0: /** michael@0: * \file michael@0: * \brief C++ API: Currency Unit Information. michael@0: */ michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: /** michael@0: * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese michael@0: * yen). This class is a thin wrapper over a UChar string that michael@0: * subclasses MeasureUnit, for use with Measure and MeasureFormat. michael@0: * michael@0: * @author Alan Liu michael@0: * @stable ICU 3.0 michael@0: */ michael@0: class U_I18N_API CurrencyUnit: public MeasureUnit { michael@0: public: michael@0: /** michael@0: * Construct an object with the given ISO currency code. michael@0: * @param isoCode the 3-letter ISO 4217 currency code; must not be michael@0: * NULL and must have length 3 michael@0: * @param ec input-output error code. If the isoCode is invalid, michael@0: * then this will be set to a failing value. michael@0: * @stable ICU 3.0 michael@0: */ michael@0: CurrencyUnit(const UChar* isoCode, UErrorCode &ec); michael@0: michael@0: /** michael@0: * Copy constructor michael@0: * @stable ICU 3.0 michael@0: */ michael@0: CurrencyUnit(const CurrencyUnit& other); michael@0: michael@0: /** michael@0: * Assignment operator michael@0: * @stable ICU 3.0 michael@0: */ michael@0: CurrencyUnit& operator=(const CurrencyUnit& other); michael@0: michael@0: /** michael@0: * Return a polymorphic clone of this object. The result will michael@0: * have the same class as returned by getDynamicClassID(). michael@0: * @stable ICU 3.0 michael@0: */ michael@0: virtual UObject* clone() const; michael@0: michael@0: /** michael@0: * Destructor michael@0: * @stable ICU 3.0 michael@0: */ michael@0: virtual ~CurrencyUnit(); michael@0: michael@0: /** michael@0: * Equality operator. Return true if this object is equal michael@0: * to the given object. michael@0: * @stable ICU 3.0 michael@0: */ michael@0: UBool operator==(const UObject& other) const; michael@0: michael@0: /** michael@0: * Returns a unique class ID for this object POLYMORPHICALLY. michael@0: * This method implements a simple form of RTTI used by ICU. michael@0: * @return The class ID for this object. All objects of a given michael@0: * class have the same class ID. Objects of other classes have michael@0: * different class IDs. michael@0: * @stable ICU 3.0 michael@0: */ michael@0: virtual UClassID getDynamicClassID() const; michael@0: michael@0: /** michael@0: * Returns the class ID for this class. This is used to compare to michael@0: * the return value of getDynamicClassID(). michael@0: * @return The class ID for all objects of this class. michael@0: * @stable ICU 3.0 michael@0: */ michael@0: static UClassID U_EXPORT2 getStaticClassID(); michael@0: michael@0: /** michael@0: * Return the ISO currency code of this object. michael@0: * @stable ICU 3.0 michael@0: */ michael@0: inline const UChar* getISOCurrency() const; michael@0: michael@0: private: michael@0: /** michael@0: * The ISO 4217 code of this object. michael@0: */ michael@0: UChar isoCode[4]; michael@0: }; michael@0: michael@0: inline const UChar* CurrencyUnit::getISOCurrency() const { michael@0: return isoCode; michael@0: } michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif // !UCONFIG_NO_FORMATTING michael@0: #endif // __CURRENCYUNIT_H__