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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/i18n/currpinf.cpp ('k') | icu46/source/i18n/datefmt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/i18n/currunit.cpp
===================================================================
--- icu46/source/i18n/currunit.cpp (revision 0)
+++ icu46/source/i18n/currunit.cpp (revision 0)
@@ -0,0 +1,62 @@
+/*
+**********************************************************************
+* Copyright (c) 2004-2010, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+* Author: Alan Liu
+* Created: April 26, 2004
+* Since: ICU 3.0
+**********************************************************************
+*/
+#include <typeinfo> // for 'typeid' to work
+
+#include "unicode/utypes.h"
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/currunit.h"
+#include "unicode/ustring.h"
+
+U_NAMESPACE_BEGIN
+
+CurrencyUnit::CurrencyUnit(const UChar* _isoCode, UErrorCode& ec) {
+ *isoCode = 0;
+ if (U_SUCCESS(ec)) {
+ if (_isoCode && u_strlen(_isoCode)==3) {
+ u_strcpy(isoCode, _isoCode);
+ } else {
+ ec = U_ILLEGAL_ARGUMENT_ERROR;
+ }
+ }
+}
+
+CurrencyUnit::CurrencyUnit(const CurrencyUnit& other) :
+ MeasureUnit(other) {
+ *this = other;
+}
+
+CurrencyUnit& CurrencyUnit::operator=(const CurrencyUnit& other) {
+ if (this != &other) {
+ u_strcpy(isoCode, other.isoCode);
+ }
+ return *this;
+}
+
+UObject* CurrencyUnit::clone() const {
+ return new CurrencyUnit(*this);
+}
+
+CurrencyUnit::~CurrencyUnit() {
+}
+
+UBool CurrencyUnit::operator==(const UObject& other) const {
+ const CurrencyUnit& c = (const CurrencyUnit&) other;
+ return typeid(*this) == typeid(other) &&
+ u_strcmp(isoCode, c.isoCode) == 0;
+}
+
+UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyUnit)
+
+U_NAMESPACE_END
+
+#endif // !UCONFIG_NO_FORMATTING
Property changes on: icu46/source/i18n/currunit.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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