ICU 4.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
currunit.h
Go to the documentation of this file.
1 /*
2 **********************************************************************
3 * Copyright (c) 2004-2006, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Author: Alan Liu
7 * Created: April 26, 2004
8 * Since: ICU 3.0
9 **********************************************************************
10 */
11 #ifndef __CURRENCYUNIT_H__
12 #define __CURRENCYUNIT_H__
13 
14 #include "unicode/utypes.h"
15 
16 #if !UCONFIG_NO_FORMATTING
17 
18 #include "unicode/measunit.h"
19 
26 
36  public:
45  CurrencyUnit(const UChar* isoCode, UErrorCode &ec);
46 
51  CurrencyUnit(const CurrencyUnit& other);
52 
57  CurrencyUnit& operator=(const CurrencyUnit& other);
58 
64  virtual UObject* clone() const;
65 
70  virtual ~CurrencyUnit();
71 
77  UBool operator==(const UObject& other) const;
78 
87  virtual UClassID getDynamicClassID() const;
88 
95  static UClassID U_EXPORT2 getStaticClassID();
96 
101  inline const UChar* getISOCurrency() const;
102 
103  private:
107  UChar isoCode[4];
108 };
109 
110 inline const UChar* CurrencyUnit::getISOCurrency() const {
111  return isoCode;
112 }
113 
115 
116 #endif // !UCONFIG_NO_FORMATTING
117 #endif // __CURRENCYUNIT_H__
virtual UObject * clone() const =0
Return a polymorphic clone of this object.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:475
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:183
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:36
C++ API: A unit for measuring a quantity.
A unit of currency, such as USD (U.S.
Definition: currunit.h:35
#define U_EXPORT2
Definition: platform.h:338
uint16_t UChar
Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
Definition: umachine.h:299
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API If the compiler doesn't support namespaces...
Definition: uversion.h:184
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:212
const UChar * getISOCurrency() const
Return the ISO currency code of this object.
Definition: currunit.h:110
void * UClassID
UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ c...
Definition: utypes.h:339
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:593
Basic definitions for ICU, for both C and C++ APIs.
virtual UBool operator==(const UObject &other) const =0
Equality operator.
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
int8_t UBool
The ICU boolean type.
Definition: umachine.h:208