]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/currfmt.cpp
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (c) 2004-2014 International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
9 * Created: April 20, 2004
11 **********************************************************************
13 #include "unicode/utypes.h"
15 #if !UCONFIG_NO_FORMATTING
18 #include "unicode/numfmt.h"
19 #include "unicode/curramt.h"
23 CurrencyFormat::CurrencyFormat(const Locale
& locale
, UErrorCode
& ec
) :
24 MeasureFormat(locale
, UMEASFMT_WIDTH_WIDE
, ec
)
28 CurrencyFormat::CurrencyFormat(const CurrencyFormat
& other
) :
33 CurrencyFormat::~CurrencyFormat() {
36 Format
* CurrencyFormat::clone() const {
37 return new CurrencyFormat(*this);
40 UnicodeString
& CurrencyFormat::format(const Formattable
& obj
,
41 UnicodeString
& appendTo
,
45 return getCurrencyFormatInternal().format(obj
, appendTo
, pos
, ec
);
48 void CurrencyFormat::parseObject(const UnicodeString
& source
,
50 ParsePosition
& pos
) const
52 CurrencyAmount
* currAmt
= getCurrencyFormatInternal().parseCurrency(source
, pos
);
53 if (currAmt
!= NULL
) {
54 result
.adoptObject(currAmt
);
58 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyFormat
)
62 #endif /* #if !UCONFIG_NO_FORMATTING */