intl/icu/source/i18n/curramt.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/curramt.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +/*
     1.5 +**********************************************************************
     1.6 +* Copyright (c) 2004, International Business Machines
     1.7 +* Corporation and others.  All Rights Reserved.
     1.8 +**********************************************************************
     1.9 +* Author: Alan Liu
    1.10 +* Created: April 26, 2004
    1.11 +* Since: ICU 3.0
    1.12 +**********************************************************************
    1.13 +*/
    1.14 +#include "unicode/utypes.h"
    1.15 +
    1.16 +#if !UCONFIG_NO_FORMATTING
    1.17 +
    1.18 +#include "unicode/curramt.h"
    1.19 +#include "unicode/currunit.h"
    1.20 +
    1.21 +U_NAMESPACE_BEGIN
    1.22 +
    1.23 +CurrencyAmount::CurrencyAmount(const Formattable& amount, const UChar* isoCode,
    1.24 +                               UErrorCode& ec) :
    1.25 +    Measure(amount, new CurrencyUnit(isoCode, ec), ec) {
    1.26 +}
    1.27 +
    1.28 +CurrencyAmount::CurrencyAmount(double amount, const UChar* isoCode,
    1.29 +                               UErrorCode& ec) :
    1.30 +    Measure(Formattable(amount), new CurrencyUnit(isoCode, ec), ec) {
    1.31 +}
    1.32 +
    1.33 +CurrencyAmount::CurrencyAmount(const CurrencyAmount& other) :
    1.34 +    Measure(other) {
    1.35 +}
    1.36 +
    1.37 +CurrencyAmount& CurrencyAmount::operator=(const CurrencyAmount& other) {
    1.38 +    Measure::operator=(other);
    1.39 +    return *this;
    1.40 +}
    1.41 +
    1.42 +UObject* CurrencyAmount::clone() const {
    1.43 +    return new CurrencyAmount(*this);
    1.44 +}
    1.45 +
    1.46 +CurrencyAmount::~CurrencyAmount() {
    1.47 +}
    1.48 +    
    1.49 +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyAmount)
    1.50 +
    1.51 +U_NAMESPACE_END
    1.52 +
    1.53 +#endif // !UCONFIG_NO_FORMATTING

mercurial