intl/icu/source/i18n/unicode/currunit.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/unicode/currunit.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,117 @@
     1.4 +/*
     1.5 +**********************************************************************
     1.6 +* Copyright (c) 2004-2006, International Business Machines
     1.7 +* Corporation and others.  All Rights Reserved.
     1.8 +**********************************************************************
     1.9 +* Author: Alan Liu
    1.10 +* Created: April 26, 2004
    1.11 +* Since: ICU 3.0
    1.12 +**********************************************************************
    1.13 +*/
    1.14 +#ifndef __CURRENCYUNIT_H__
    1.15 +#define __CURRENCYUNIT_H__
    1.16 +
    1.17 +#include "unicode/utypes.h"
    1.18 +
    1.19 +#if !UCONFIG_NO_FORMATTING
    1.20 +
    1.21 +#include "unicode/measunit.h"
    1.22 +
    1.23 +/**
    1.24 + * \file 
    1.25 + * \brief C++ API: Currency Unit Information.
    1.26 + */
    1.27 + 
    1.28 +U_NAMESPACE_BEGIN
    1.29 +
    1.30 +/**
    1.31 + * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
    1.32 + * yen).  This class is a thin wrapper over a UChar string that
    1.33 + * subclasses MeasureUnit, for use with Measure and MeasureFormat.
    1.34 + *
    1.35 + * @author Alan Liu
    1.36 + * @stable ICU 3.0
    1.37 + */
    1.38 +class U_I18N_API CurrencyUnit: public MeasureUnit {
    1.39 + public:
    1.40 +    /**
    1.41 +     * Construct an object with the given ISO currency code.
    1.42 +     * @param isoCode the 3-letter ISO 4217 currency code; must not be
    1.43 +     * NULL and must have length 3
    1.44 +     * @param ec input-output error code. If the isoCode is invalid,
    1.45 +     * then this will be set to a failing value.
    1.46 +     * @stable ICU 3.0
    1.47 +     */
    1.48 +    CurrencyUnit(const UChar* isoCode, UErrorCode &ec);
    1.49 +
    1.50 +    /**
    1.51 +     * Copy constructor
    1.52 +     * @stable ICU 3.0
    1.53 +     */
    1.54 +    CurrencyUnit(const CurrencyUnit& other);
    1.55 +
    1.56 +    /**
    1.57 +     * Assignment operator
    1.58 +     * @stable ICU 3.0
    1.59 +     */
    1.60 +    CurrencyUnit& operator=(const CurrencyUnit& other);
    1.61 +
    1.62 +    /**
    1.63 +     * Return a polymorphic clone of this object.  The result will
    1.64 +     * have the same class as returned by getDynamicClassID().
    1.65 +     * @stable ICU 3.0
    1.66 +     */
    1.67 +    virtual UObject* clone() const;
    1.68 +
    1.69 +    /**
    1.70 +     * Destructor
    1.71 +     * @stable ICU 3.0
    1.72 +     */
    1.73 +    virtual ~CurrencyUnit();
    1.74 +
    1.75 +    /**
    1.76 +     * Equality operator.  Return true if this object is equal
    1.77 +     * to the given object.
    1.78 +     * @stable ICU 3.0
    1.79 +     */
    1.80 +    UBool operator==(const UObject& other) const;
    1.81 +
    1.82 +    /**
    1.83 +     * Returns a unique class ID for this object POLYMORPHICALLY.
    1.84 +     * This method implements a simple form of RTTI used by ICU.
    1.85 +     * @return The class ID for this object. All objects of a given
    1.86 +     * class have the same class ID.  Objects of other classes have
    1.87 +     * different class IDs.
    1.88 +     * @stable ICU 3.0
    1.89 +     */
    1.90 +    virtual UClassID getDynamicClassID() const;
    1.91 +
    1.92 +    /**
    1.93 +     * Returns the class ID for this class. This is used to compare to
    1.94 +     * the return value of getDynamicClassID().
    1.95 +     * @return The class ID for all objects of this class.
    1.96 +     * @stable ICU 3.0
    1.97 +     */
    1.98 +    static UClassID U_EXPORT2 getStaticClassID();
    1.99 +
   1.100 +    /**
   1.101 +     * Return the ISO currency code of this object.
   1.102 +     * @stable ICU 3.0
   1.103 +     */
   1.104 +    inline const UChar* getISOCurrency() const;
   1.105 +
   1.106 + private:
   1.107 +    /**
   1.108 +     * The ISO 4217 code of this object.
   1.109 +     */
   1.110 +    UChar isoCode[4];
   1.111 +};
   1.112 +
   1.113 +inline const UChar* CurrencyUnit::getISOCurrency() const {
   1.114 +    return isoCode;
   1.115 +}
   1.116 +
   1.117 +U_NAMESPACE_END
   1.118 +
   1.119 +#endif // !UCONFIG_NO_FORMATTING
   1.120 +#endif // __CURRENCYUNIT_H__

mercurial