ICU 58.2 58.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

curramt.h
Go to the documentation of this file.
1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 **********************************************************************
5 * Copyright (c) 2004-2006, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
8 * Author: Alan Liu
9 * Created: April 26, 2004
10 * Since: ICU 3.0
11 **********************************************************************
12 */
13 #ifndef __CURRENCYAMOUNT_H__
14 #define __CURRENCYAMOUNT_H__
15
16 #include "unicode/utypes.h"
17
18 #if !UCONFIG_NO_FORMATTING
19
20 #include "unicode/measure.h"
21 #include "unicode/currunit.h"
22
28 U_NAMESPACE_BEGIN
29
37 class U_I18N_API CurrencyAmount: public Measure {
38 public:
49 CurrencyAmount(const Formattable& amount, const UChar* isoCode,
50 UErrorCode &ec);
51
62 CurrencyAmount(double amount, const UChar* isoCode,
63 UErrorCode &ec);
64
69 CurrencyAmount(const CurrencyAmount& other);
70
75 CurrencyAmount& operator=(const CurrencyAmount& other);
76
82 virtual UObject* clone() const;
83
88 virtual ~CurrencyAmount();
89
98 virtual UClassID getDynamicClassID() const;
99
106 static UClassID U_EXPORT2 getStaticClassID();
107
112 inline const CurrencyUnit& getCurrency() const;
113
118 inline const UChar* getISOCurrency() const;
119 };
120
121 inline const CurrencyUnit& CurrencyAmount::getCurrency() const {
122 return (const CurrencyUnit&) getUnit();
123 }
124
125 inline const UChar* CurrencyAmount::getISOCurrency() const {
126 return getCurrency().getISOCurrency();
127 }
128
129 U_NAMESPACE_END
130
131 #endif // !UCONFIG_NO_FORMATTING
132 #endif // __CURRENCYAMOUNT_H__
currunit.h
C++ API: Currency Unit Information.
icu::Measure
An amount of a specified unit, consisting of a number and a Unit.
Definition: measure.h:43
icu::Measure::getUnit
const MeasureUnit & getUnit() const
Return a reference to the unit of this object.
Definition: measure.h:154
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler&#39;s RTTI.
Definition: uobject.h:93
icu::CurrencyAmount::getCurrency
const CurrencyUnit & getCurrency() const
Return the currency unit object of this object.
Definition: curramt.h:121
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:360
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
icu::Measure::clone
virtual UObject * clone() const
Return a polymorphic clone of this object.
measure.h
C++ API: MeasureUnit object.
icu::CurrencyUnit
A unit of currency, such as USD (U.S.
Definition: currunit.h:37
icu::Measure::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:337
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
icu::Measure::operator=
Measure & operator=(const Measure &other)
Assignment operator.
icu::CurrencyAmount::getISOCurrency
const UChar * getISOCurrency() const
Return the ISO currency code of this object.
Definition: curramt.h:125
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
icu::Measure::getDynamicClassID
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:68
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
icu::CurrencyAmount
A currency together with a numeric amount, such as 200 USD.
Definition: curramt.h:37