ICU 68.2: curramt.h Source File

ICU 68.2 68.2

curramt.h
Go to the documentation of this file.
1 // © 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 U_SHOW_CPLUSPLUS_API
19
20 #if !UCONFIG_NO_FORMATTING
21
22 #include "unicode/measure.h"
23 #include "unicode/currunit.h"
24
30 U_NAMESPACE_BEGIN
31
39 class U_I18N_API CurrencyAmount: public Measure {
40 public:
51 CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode,
52 UErrorCode &ec);
53
64 CurrencyAmount(double amount, ConstChar16Ptr isoCode,
65 UErrorCode &ec);
66
71 CurrencyAmount(const CurrencyAmount& other);
72
77 CurrencyAmount& operator=(const CurrencyAmount& other);
78
84 virtual CurrencyAmount* clone() const;
85
90 virtual ~CurrencyAmount();
91
100 virtual UClassID getDynamicClassID() const;
101
108 static UClassID U_EXPORT2 getStaticClassID();
109
114 inline const CurrencyUnit& getCurrency() const;
115
120 inline const char16_t* getISOCurrency() const;
121 };
122
123 inline const CurrencyUnit& CurrencyAmount::getCurrency() const {
124 return (const CurrencyUnit&) getUnit();
125 }
126
127 inline const char16_t* CurrencyAmount::getISOCurrency() const {
128 return getCurrency().getISOCurrency();
129 }
130
131 U_NAMESPACE_END
132
133 #endif // !UCONFIG_NO_FORMATTING
134
135 #endif /* U_SHOW_CPLUSPLUS_API */
136
137 #endif // __CURRENCYAMOUNT_H__
icu::CurrencyAmount::CurrencyAmount
CurrencyAmount(const CurrencyAmount &other)
Copy constructor.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::CurrencyUnit
A unit of currency, such as USD (U.S.
Definition: currunit.h:39
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:301
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:64
icu::CurrencyAmount::clone
virtual CurrencyAmount * clone() const
Return a polymorphic clone of this object.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
icu::CurrencyAmount::getDynamicClassID
virtual UClassID getDynamicClassID() const
Returns a unique class ID for this object POLYMORPHICALLY.
icu::CurrencyAmount::~CurrencyAmount
virtual ~CurrencyAmount()
Destructor.
icu::CurrencyAmount::CurrencyAmount
CurrencyAmount(double amount, ConstChar16Ptr isoCode, UErrorCode &ec)
Construct an object with the given numeric amount and the given ISO currency code.
icu::Measure
An amount of a specified unit, consisting of a number and a Unit.
Definition: measure.h:45
icu::CurrencyAmount::operator=
CurrencyAmount & operator=(const CurrencyAmount &other)
Assignment operator.
icu::CurrencyAmount::CurrencyAmount
CurrencyAmount(const Formattable &amount, ConstChar16Ptr isoCode, UErrorCode &ec)
Construct an object with the given numeric amount and the given ISO currency code.
icu::ConstChar16Ptr
const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
Definition: char16ptr.h:149
icu::CurrencyAmount
A currency together with a numeric amount, such as 200 USD.
Definition: curramt.h:39
currunit.h
C++ API: Currency Unit Information.
icu::CurrencyAmount::getStaticClassID
static UClassID getStaticClassID()
Returns the class ID for this class.
measure.h
C++ API: MeasureUnit object.