]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/currunit.cpp
2 **********************************************************************
3 * Copyright (c) 2004-2014, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
7 * Created: April 26, 2004
9 **********************************************************************
11 #include "unicode/utypes.h"
13 #if !UCONFIG_NO_FORMATTING
15 #include "unicode/currunit.h"
16 #include "unicode/ustring.h"
20 CurrencyUnit::CurrencyUnit(const UChar
* _isoCode
, UErrorCode
& ec
) {
23 if (_isoCode
&& u_strlen(_isoCode
)==3) {
24 u_strcpy(isoCode
, _isoCode
);
25 char simpleIsoCode
[4];
26 u_UCharsToChars(isoCode
, simpleIsoCode
, 4);
27 initCurrency(simpleIsoCode
);
29 ec
= U_ILLEGAL_ARGUMENT_ERROR
;
34 CurrencyUnit::CurrencyUnit(const CurrencyUnit
& other
) :
36 u_strcpy(isoCode
, other
.isoCode
);
39 CurrencyUnit
& CurrencyUnit::operator=(const CurrencyUnit
& other
) {
43 MeasureUnit::operator=(other
);
44 u_strcpy(isoCode
, other
.isoCode
);
48 UObject
* CurrencyUnit::clone() const {
49 return new CurrencyUnit(*this);
52 CurrencyUnit::~CurrencyUnit() {
55 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyUnit
)
59 #endif // !UCONFIG_NO_FORMATTING