ICU 71.1 71.1

currunit.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-2014, 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 __CURRENCYUNIT_H__
14 #define __CURRENCYUNIT_H__
15
16 #include "unicode/utypes.h"
17
18 #if U_SHOW_CPLUSPLUS_API
19
20 #if !UCONFIG_NO_FORMATTING
21
22 #include "unicode/measunit.h"
23
29 U_NAMESPACE_BEGIN
30
39 class U_I18N_API CurrencyUnit: public MeasureUnit {
40 public:
45 CurrencyUnit();
46
57 CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec);
58
68 CurrencyUnit(StringPiece isoCode, UErrorCode &ec);
69
74 CurrencyUnit(const CurrencyUnit& other);
75
84 CurrencyUnit(const MeasureUnit& measureUnit, UErrorCode &ec);
85
90 CurrencyUnit& operator=(const CurrencyUnit& other);
91
97 virtual CurrencyUnit* clone() const override;
98
103 virtual ~CurrencyUnit();
104
113 virtual UClassID getDynamicClassID() const override;
114
121 static UClassID U_EXPORT2 getStaticClassID();
122
127 inline const char16_t* getISOCurrency() const;
128
129 private:
133 char16_t isoCode[4];
134 };
135
136 inline const char16_t* CurrencyUnit::getISOCurrency() const {
137 return isoCode;
138 }
139
140 U_NAMESPACE_END
141
142 #endif // !UCONFIG_NO_FORMATTING
143
144 #endif /* U_SHOW_CPLUSPLUS_API */
145
146 #endif // __CURRENCYUNIT_H__
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:368
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
Definition: utypes.h:301
icu::MeasureUnit::clone
virtual MeasureUnit * clone() const
Returns 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::MeasureUnit::getDynamicClassID
virtual UClassID getDynamicClassID(void) const override
Returns a unique class ID POLYMORPHICALLY.
icu::MeasureUnit::operator=
MeasureUnit & operator=(const MeasureUnit &other)
Copy assignment operator.
icu::MeasureUnit::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::ConstChar16Ptr
const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
Definition: char16ptr.h:149
measunit.h
C++ API: A unit for measuring a quantity.
icu::StringPiece
A string-like object that points to a sized piece of memory.
Definition: stringpiece.h:60