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

Side by Side Diff: icu46/source/i18n/currunit.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/currpinf.cpp ('k') | icu46/source/i18n/datefmt.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 26, 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 "unicode/currunit.h"
18 #include "unicode/ustring.h"
19
20 U_NAMESPACE_BEGIN
21
22 CurrencyUnit::CurrencyUnit(const UChar* _isoCode, UErrorCode& ec) {
23 *isoCode = 0;
24 if (U_SUCCESS(ec)) {
25 if (_isoCode && u_strlen(_isoCode)==3) {
26 u_strcpy(isoCode, _isoCode);
27 } else {
28 ec = U_ILLEGAL_ARGUMENT_ERROR;
29 }
30 }
31 }
32
33 CurrencyUnit::CurrencyUnit(const CurrencyUnit& other) :
34 MeasureUnit(other) {
35 *this = other;
36 }
37
38 CurrencyUnit& CurrencyUnit::operator=(const CurrencyUnit& other) {
39 if (this != &other) {
40 u_strcpy(isoCode, other.isoCode);
41 }
42 return *this;
43 }
44
45 UObject* CurrencyUnit::clone() const {
46 return new CurrencyUnit(*this);
47 }
48
49 CurrencyUnit::~CurrencyUnit() {
50 }
51
52 UBool CurrencyUnit::operator==(const UObject& other) const {
53 const CurrencyUnit& c = (const CurrencyUnit&) other;
54 return typeid(*this) == typeid(other) &&
55 u_strcmp(isoCode, c.isoCode) == 0;
56 }
57
58 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyUnit)
59
60 U_NAMESPACE_END
61
62 #endif // !UCONFIG_NO_FORMATTING
OLDNEW
« no previous file with comments | « icu46/source/i18n/currpinf.cpp ('k') | icu46/source/i18n/datefmt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698