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

Unified Diff: source/i18n/unum.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months 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 | « source/i18n/unicode/utrans.h ('k') | source/i18n/uregex.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/unum.cpp
diff --git a/source/i18n/unum.cpp b/source/i18n/unum.cpp
index 9703f5d6a99b450bf91af658157e834812344d17..802caaddd8910a2b8b7312159f9da243a0080068 100644
--- a/source/i18n/unum.cpp
+++ b/source/i18n/unum.cpp
@@ -1,6 +1,6 @@
/*
*******************************************************************************
-* Copyright (C) 1996-2013, International Business Machines
+* Copyright (C) 1996-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* Modification History:
@@ -25,6 +25,7 @@
#include "unicode/dcfmtsym.h"
#include "unicode/curramt.h"
#include "unicode/localpointer.h"
+#include "unicode/udisplaycontext.h"
#include "uassert.h"
#include "cpputils.h"
#include "cstring.h"
@@ -51,6 +52,10 @@ unum_open( UNumberFormatStyle style,
case UNUM_CURRENCY:
case UNUM_PERCENT:
case UNUM_SCIENTIFIC:
+ case UNUM_CURRENCY_ISO:
+ case UNUM_CURRENCY_PLURAL:
+ case UNUM_CURRENCY_ACCOUNTING:
+ case UNUM_CASH_CURRENCY:
retVal = NumberFormat::createInstance(Locale(locale), style, *status);
break;
@@ -783,6 +788,25 @@ unum_getLocaleByType(const UNumberFormat *fmt,
return ((const Format*)fmt)->getLocaleID(type, *status);
}
+U_CAPI void U_EXPORT2
+unum_setContext(UNumberFormat* fmt, UDisplayContext value, UErrorCode* status)
+{
+ if (U_FAILURE(*status)) {
+ return;
+ }
+ ((NumberFormat*)fmt)->setContext(value, *status);
+ return;
+}
+
+U_CAPI UDisplayContext U_EXPORT2
+unum_getContext(const UNumberFormat *fmt, UDisplayContextType type, UErrorCode* status)
+{
+ if (U_FAILURE(*status)) {
+ return (UDisplayContext)0;
+ }
+ return ((const NumberFormat*)fmt)->getContext(type, *status);
+}
+
U_INTERNAL UFormattable * U_EXPORT2
unum_parseToUFormattable(const UNumberFormat* fmt,
UFormattable *result,
« no previous file with comments | « source/i18n/unicode/utrans.h ('k') | source/i18n/uregex.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698