ICU 66.1 66.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
29U_NAMESPACE_BEGIN
30
40 public:
46
58
59#ifndef U_HIDE_DRAFT_API
70#endif /* U_HIDE_DRAFT_API */
71
77
86 CurrencyUnit(const MeasureUnit& measureUnit, UErrorCode &ec);
87
93
99 virtual CurrencyUnit* clone() const;
100
105 virtual ~CurrencyUnit();
106
116
123 static UClassID U_EXPORT2 getStaticClassID();
124
129 inline const char16_t* getISOCurrency() const;
130
131 private:
135 char16_t isoCode[4];
136};
137
138inline const char16_t* CurrencyUnit::getISOCurrency() const {
139 return isoCode;
140}
141
142U_NAMESPACE_END
143
144#endif // !UCONFIG_NO_FORMATTING
145
146#endif /* U_SHOW_CPLUSPLUS_API */
147
148#endif // __CURRENCYUNIT_H__
const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
Definition: char16ptr.h:149
A unit of currency, such as USD (U.S.
Definition: currunit.h:39
CurrencyUnit(const CurrencyUnit &other)
Copy constructor.
virtual ~CurrencyUnit()
Destructor.
CurrencyUnit & operator=(const CurrencyUnit &other)
Assignment operator.
CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec)
Construct an object with the given ISO currency code.
static UClassID getStaticClassID()
Returns the class ID for this class.
virtual UClassID getDynamicClassID() const
Returns a unique class ID for this object POLYMORPHICALLY.
CurrencyUnit()
Default constructor.
CurrencyUnit(const MeasureUnit &measureUnit, UErrorCode &ec)
Copy constructor from MeasureUnit.
CurrencyUnit(StringPiece isoCode, UErrorCode &ec)
Construct an object with the given ISO currency code.
virtual CurrencyUnit * clone() const
Return a polymorphic clone of this object.
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:40
A string-like object that points to a sized piece of memory.
Definition: stringpiece.h:60
C++ API: A unit for measuring a quantity.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition: utypes.h:301