ICU 62.1  62.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 !UCONFIG_NO_FORMATTING
19 
20 #include "unicode/measunit.h"
21 
28 
38  public:
43  CurrencyUnit();
44 
55 
60  CurrencyUnit(const CurrencyUnit& other);
61 
62 #ifndef U_HIDE_DRAFT_API
63 
71  CurrencyUnit(const MeasureUnit& measureUnit, UErrorCode &ec);
72 #endif /* U_HIDE_DRAFT_API */
73 
78  CurrencyUnit& operator=(const CurrencyUnit& other);
79 
85  virtual UObject* clone() const;
86 
91  virtual ~CurrencyUnit();
92 
101  virtual UClassID getDynamicClassID() const;
102 
109  static UClassID U_EXPORT2 getStaticClassID();
110 
115  inline const char16_t* getISOCurrency() const;
116 
117  private:
121  char16_t isoCode[4];
122 };
123 
124 inline const char16_t* CurrencyUnit::getISOCurrency() const {
125  return isoCode;
126 }
127 
129 
130 #endif // !UCONFIG_NO_FORMATTING
131 #endif // __CURRENCYUNIT_H__
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:38
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:37
U_I18N_API
#define U_I18N_API
Definition: utypes.h:360
icu::MeasureUnit::getDynamicClassID
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:93
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:396
icu::MeasureUnit::operator=
MeasureUnit & operator=(const MeasureUnit &other)
Assignment operator.
icu::MeasureUnit::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::MeasureUnit::clone
virtual UObject * clone() const
Returns a polymorphic clone of this object.
icu::ConstChar16Ptr
const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
Definition: char16ptr.h:142
U_NAMESPACE_END
#define U_NAMESPACE_END
Definition: uversion.h:138
measunit.h
C++ API: A unit for measuring a quantity.
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
Definition: uversion.h:137