Update readme.md
[openttd-joker.git] / lib / shared / include / unicode / currunit.h
blobd79836bb7495264ebab19219c656cbc524adbcb7
1 /*
2 **********************************************************************
3 * Copyright (c) 2004-2014, 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 **********************************************************************
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.
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.
32 * @author Alan Liu
33 * @stable ICU 3.0
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
45 CurrencyUnit(const UChar* isoCode, UErrorCode &ec);
47 /**
48 * Copy constructor
49 * @stable ICU 3.0
51 CurrencyUnit(const CurrencyUnit& other);
53 /**
54 * Assignment operator
55 * @stable ICU 3.0
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
64 virtual UObject* clone() const;
66 /**
67 * Destructor
68 * @stable ICU 3.0
70 virtual ~CurrencyUnit();
72 /**
73 * Returns a unique class ID for this object POLYMORPHICALLY.
74 * This method implements a simple form of RTTI used by ICU.
75 * @return The class ID for this object. All objects of a given
76 * class have the same class ID. Objects of other classes have
77 * different class IDs.
78 * @stable ICU 3.0
80 virtual UClassID getDynamicClassID() const;
82 /**
83 * Returns the class ID for this class. This is used to compare to
84 * the return value of getDynamicClassID().
85 * @return The class ID for all objects of this class.
86 * @stable ICU 3.0
88 static UClassID U_EXPORT2 getStaticClassID();
90 /**
91 * Return the ISO currency code of this object.
92 * @stable ICU 3.0
94 inline const UChar* getISOCurrency() const;
96 private:
97 /**
98 * The ISO 4217 code of this object.
100 UChar isoCode[4];
103 inline const UChar* CurrencyUnit::getISOCurrency() const {
104 return isoCode;
107 U_NAMESPACE_END
109 #endif // !UCONFIG_NO_FORMATTING
110 #endif // __CURRENCYUNIT_H__