Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: icu46/source/i18n/currfmt.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « icu46/source/i18n/currfmt.h ('k') | icu46/source/i18n/currpinf.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 **********************************************************************
3 * Copyright (c) 2004-2010, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Author: Alan Liu
7 * Created: April 20, 2004
8 * Since: ICU 3.0
9 **********************************************************************
10 */
11 #include <typeinfo> // for 'typeid' to work
12
13 #include "unicode/utypes.h"
14
15 #if !UCONFIG_NO_FORMATTING
16
17 #include "currfmt.h"
18 #include "unicode/numfmt.h"
19
20 U_NAMESPACE_BEGIN
21
22 CurrencyFormat::CurrencyFormat(const Locale& locale, UErrorCode& ec) :
23 fmt(NULL)
24 {
25 fmt = NumberFormat::createCurrencyInstance(locale, ec);
26 }
27
28 CurrencyFormat::CurrencyFormat(const CurrencyFormat& other) :
29 MeasureFormat(other), fmt(NULL)
30 {
31 fmt = (NumberFormat*) other.fmt->clone();
32 }
33
34 CurrencyFormat::~CurrencyFormat() {
35 delete fmt;
36 }
37
38 UBool CurrencyFormat::operator==(const Format& other) const {
39 if (this == &other) {
40 return TRUE;
41 }
42 if (typeid(*this) != typeid(other)) {
43 return FALSE;
44 }
45 const CurrencyFormat* c = (const CurrencyFormat*) &other;
46 return *fmt == *c->fmt;
47 }
48
49 Format* CurrencyFormat::clone() const {
50 return new CurrencyFormat(*this);
51 }
52
53 UnicodeString& CurrencyFormat::format(const Formattable& obj,
54 UnicodeString& appendTo,
55 FieldPosition& pos,
56 UErrorCode& ec) const
57 {
58 return fmt->format(obj, appendTo, pos, ec);
59 }
60
61 void CurrencyFormat::parseObject(const UnicodeString& source,
62 Formattable& result,
63 ParsePosition& pos) const
64 {
65 fmt->parseCurrency(source, result, pos);
66 }
67
68 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyFormat)
69
70 U_NAMESPACE_END
71
72 #endif /* #if !UCONFIG_NO_FORMATTING */
OLDNEW
« no previous file with comments | « icu46/source/i18n/currfmt.h ('k') | icu46/source/i18n/currpinf.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698