curramt.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-2006, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
* Created: April 26, 2004
* Since: ICU 3.0
**********************************************************************
*/
#ifndef __CURRENCYAMOUNT_H__
#define __CURRENCYAMOUNT_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/measure.h"
#include "unicode/currunit.h"
U_NAMESPACE_BEGIN
class U_I18N_API CurrencyAmount: public Measure {
public:
CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode,
UErrorCode &ec);
CurrencyAmount(double amount, ConstChar16Ptr isoCode,
UErrorCode &ec);
CurrencyAmount(const CurrencyAmount& other);
CurrencyAmount& operator=(const CurrencyAmount& other);
virtual CurrencyAmount* clone() const override;
virtual ~CurrencyAmount();
virtual UClassID getDynamicClassID() const override;
static UClassID U_EXPORT2 getStaticClassID();
const CurrencyUnit& getCurrency() const;
inline const char16_t* getISOCurrency() const;
};
inline const char16_t* CurrencyAmount::getISOCurrency() const {
return getCurrency().getISOCurrency();
}
U_NAMESPACE_END
#endif // !UCONFIG_NO_FORMATTING
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __CURRENCYAMOUNT_H__
icu::ConstChar16Ptr
const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
Definition: char16ptr.h:149
icu::CurrencyAmount
A currency together with a numeric amount, such as 200 USD.
Definition: curramt.h:39
icu::CurrencyAmount::CurrencyAmount
CurrencyAmount(const CurrencyAmount &other)
Copy constructor.
icu::CurrencyAmount::getStaticClassID
static UClassID getStaticClassID()
Returns the class ID for this class.
icu::CurrencyAmount::operator=
CurrencyAmount & operator=(const CurrencyAmount &other)
Assignment operator.
icu::CurrencyAmount::getDynamicClassID
virtual UClassID getDynamicClassID() const override
Returns a unique class ID for this object POLYMORPHICALLY.
icu::CurrencyAmount::getCurrency
const CurrencyUnit & getCurrency() const
Return the currency unit object of this object.
icu::CurrencyAmount::CurrencyAmount
CurrencyAmount(double amount, ConstChar16Ptr isoCode, UErrorCode &ec)
Construct an object with the given numeric amount and the given ISO currency code.
icu::CurrencyAmount::CurrencyAmount
CurrencyAmount(const Formattable &amount, ConstChar16Ptr isoCode, UErrorCode &ec)
Construct an object with the given numeric amount and the given ISO currency code.
icu::CurrencyAmount::clone
virtual CurrencyAmount * clone() const override
Return a polymorphic clone of this object.
icu::CurrencyAmount::~CurrencyAmount
virtual ~CurrencyAmount()
Destructor.
icu::CurrencyUnit
A unit of currency, such as USD (U.S.
Definition: currunit.h:39
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:64
icu::Measure
An amount of a specified unit, consisting of a number and a Unit.
Definition: measure.h:45
currunit.h
C++ API: Currency Unit Information.
measure.h
C++ API: MeasureUnit object.
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