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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2 **********************************************************************
     3 * Copyright (c) 2004-2006, International Business Machines
     4 * Corporation and others.  All Rights Reserved.
     5 **********************************************************************
     6 * Author: Alan Liu
     7 * Created: April 26, 2004
     8 * Since: ICU 3.0
     9 **********************************************************************
    10 */
    11 #ifndef __CURRENCYUNIT_H__
    12 #define __CURRENCYUNIT_H__
    14 #include "unicode/utypes.h"
    16 #if !UCONFIG_NO_FORMATTING
    18 #include "unicode/measunit.h"
    20 /**
    21  * \file 
    22  * \brief C++ API: Currency Unit Information.
    23  */
    25 U_NAMESPACE_BEGIN
    27 /**
    28  * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
    29  * yen).  This class is a thin wrapper over a UChar string that
    30  * subclasses MeasureUnit, for use with Measure and MeasureFormat.
    31  *
    32  * @author Alan Liu
    33  * @stable ICU 3.0
    34  */
    35 class U_I18N_API CurrencyUnit: public MeasureUnit {
    36  public:
    37     /**
    38      * Construct an object with the given ISO currency code.
    39      * @param isoCode the 3-letter ISO 4217 currency code; must not be
    40      * NULL and must have length 3
    41      * @param ec input-output error code. If the isoCode is invalid,
    42      * then this will be set to a failing value.
    43      * @stable ICU 3.0
    44      */
    45     CurrencyUnit(const UChar* isoCode, UErrorCode &ec);
    47     /**
    48      * Copy constructor
    49      * @stable ICU 3.0
    50      */
    51     CurrencyUnit(const CurrencyUnit& other);
    53     /**
    54      * Assignment operator
    55      * @stable ICU 3.0
    56      */
    57     CurrencyUnit& operator=(const CurrencyUnit& other);
    59     /**
    60      * Return a polymorphic clone of this object.  The result will
    61      * have the same class as returned by getDynamicClassID().
    62      * @stable ICU 3.0
    63      */
    64     virtual UObject* clone() const;
    66     /**
    67      * Destructor
    68      * @stable ICU 3.0
    69      */
    70     virtual ~CurrencyUnit();
    72     /**
    73      * Equality operator.  Return true if this object is equal
    74      * to the given object.
    75      * @stable ICU 3.0
    76      */
    77     UBool operator==(const UObject& other) const;
    79     /**
    80      * Returns a unique class ID for this object POLYMORPHICALLY.
    81      * This method implements a simple form of RTTI used by ICU.
    82      * @return The class ID for this object. All objects of a given
    83      * class have the same class ID.  Objects of other classes have
    84      * different class IDs.
    85      * @stable ICU 3.0
    86      */
    87     virtual UClassID getDynamicClassID() const;
    89     /**
    90      * Returns the class ID for this class. This is used to compare to
    91      * the return value of getDynamicClassID().
    92      * @return The class ID for all objects of this class.
    93      * @stable ICU 3.0
    94      */
    95     static UClassID U_EXPORT2 getStaticClassID();
    97     /**
    98      * Return the ISO currency code of this object.
    99      * @stable ICU 3.0
   100      */
   101     inline const UChar* getISOCurrency() const;
   103  private:
   104     /**
   105      * The ISO 4217 code of this object.
   106      */
   107     UChar isoCode[4];
   108 };
   110 inline const UChar* CurrencyUnit::getISOCurrency() const {
   111     return isoCode;
   112 }
   114 U_NAMESPACE_END
   116 #endif // !UCONFIG_NO_FORMATTING
   117 #endif // __CURRENCYUNIT_H__

mercurial