currunit.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
* Copyright (c) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
* Created: April 26, 2004
* Since: ICU 3.0
**********************************************************************
*/
#ifndef __CURRENCYUNIT_H__
#define __CURRENCYUNIT_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/measunit.h"
U_NAMESPACE_BEGIN
class U_I18N_API CurrencyUnit: public MeasureUnit {
public:
CurrencyUnit();
CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec);
CurrencyUnit(StringPiece isoCode, UErrorCode &ec);
CurrencyUnit(const CurrencyUnit& other);
CurrencyUnit(const MeasureUnit& measureUnit, UErrorCode &ec);
CurrencyUnit& operator=(const CurrencyUnit& other);
virtual CurrencyUnit* clone() const override;
virtual ~CurrencyUnit();
virtual UClassID getDynamicClassID() const override;
static UClassID U_EXPORT2 getStaticClassID();
inline const char16_t* getISOCurrency() const;
private:
char16_t isoCode[4];
};
inline const char16_t* CurrencyUnit::getISOCurrency() const {
return isoCode;
}
U_NAMESPACE_END
#endif // !UCONFIG_NO_FORMATTING
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __CURRENCYUNIT_H__
icu::ConstChar16Ptr
const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
Definition: char16ptr.h:149
icu::CurrencyUnit
A unit of currency, such as USD (U.S.
Definition: currunit.h:39
icu::CurrencyUnit::getDynamicClassID
virtual UClassID getDynamicClassID() const override
Returns a unique class ID for this object POLYMORPHICALLY.
icu::CurrencyUnit::CurrencyUnit
CurrencyUnit(const CurrencyUnit &other)
Copy constructor.
icu::CurrencyUnit::~CurrencyUnit
virtual ~CurrencyUnit()
Destructor.
icu::CurrencyUnit::clone
virtual CurrencyUnit * clone() const override
Return a polymorphic clone of this object.
icu::CurrencyUnit::CurrencyUnit
CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec)
Construct an object with the given ISO currency code.
icu::CurrencyUnit::getStaticClassID
static UClassID getStaticClassID()
Returns the class ID for this class.
icu::CurrencyUnit::CurrencyUnit
CurrencyUnit()
Default constructor.
icu::CurrencyUnit::operator=
CurrencyUnit & operator=(const CurrencyUnit &other)
Assignment operator.
icu::CurrencyUnit::CurrencyUnit
CurrencyUnit(const MeasureUnit &measureUnit, UErrorCode &ec)
Copy constructor from MeasureUnit.
icu::CurrencyUnit::CurrencyUnit
CurrencyUnit(StringPiece isoCode, UErrorCode &ec)
Construct an object with the given ISO currency code.
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:369
icu::StringPiece
A string-like object that points to a sized piece of memory.
Definition: stringpiece.h:60
measunit.h
C++ API: A unit for measuring a quantity.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
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