OLD | NEW |
1 // © 2016 and later: Unicode, Inc. and others. | 1 // © 2016 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html | 2 // License & terms of use: http://www.unicode.org/copyright.html |
3 /* | 3 /* |
4 ******************************************************************************* | 4 ******************************************************************************* |
5 * Copyright (C) 1997-2015, International Business Machines Corporation and * | 5 * Copyright (C) 1997-2015, International Business Machines Corporation and * |
6 * others. All Rights Reserved. * | 6 * others. All Rights Reserved. * |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 * | 8 * |
9 * File DECIMFMT.CPP | 9 * File DECIMFMT.CPP |
10 * | 10 * |
(...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 if (plural) { | 2164 if (plural) { |
2165 ++i; | 2165 ++i; |
2166 intl = FALSE; | 2166 intl = FALSE; |
2167 } | 2167 } |
2168 // Parse generic currency -- anything for which we | 2168 // Parse generic currency -- anything for which we |
2169 // have a display name, or any 3-letter ISO code. | 2169 // have a display name, or any 3-letter ISO code. |
2170 // Try to parse display name for our locale; first | 2170 // Try to parse display name for our locale; first |
2171 // determine our locale. | 2171 // determine our locale. |
2172 const char* loc = fCurrencyPluralInfo->getLocale().getName(); | 2172 const char* loc = fCurrencyPluralInfo->getLocale().getName(); |
2173 ParsePosition ppos(pos); | 2173 ParsePosition ppos(pos); |
| 2174 int32_t currMatchLen = 0; |
2174 UChar curr[4]; | 2175 UChar curr[4]; |
2175 UErrorCode ec = U_ZERO_ERROR; | 2176 UErrorCode ec = U_ZERO_ERROR; |
2176 // Delegate parse of display name => ISO code to Currency | 2177 // Delegate parse of display name => ISO code to Currency |
2177 uprv_parseCurrency(loc, text, ppos, type, curr, ec); | 2178 uprv_parseCurrency(loc, text, ppos, type, &currMatchLen, curr, e
c); |
2178 | 2179 |
2179 // If parse succeeds, populate currency[0] | 2180 // If parse succeeds, populate currency[0] |
2180 if (U_SUCCESS(ec) && ppos.getIndex() != pos) { | 2181 if (U_SUCCESS(ec) && ppos.getIndex() != pos) { |
2181 if (currency) { | 2182 if (currency) { |
2182 u_strcpy(currency, curr); | 2183 u_strcpy(currency, curr); |
2183 } else { | 2184 } else { |
2184 // The formatter is currency-style but the client has no
t requested | 2185 // The formatter is currency-style but the client has no
t requested |
2185 // the value of the parsed currency. In this case, if th
at value does | 2186 // the value of the parsed currency. In this case, if th
at value does |
2186 // not match the formatter's current value, then the par
se fails. | 2187 // not match the formatter's current value, then the par
se fails. |
2187 UChar effectiveCurr[4]; | 2188 UChar effectiveCurr[4]; |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3286 void DecimalFormat::setParseAllInput(UNumberFormatAttributeValue value) { | 3287 void DecimalFormat::setParseAllInput(UNumberFormatAttributeValue value) { |
3287 fParseAllInput = value; | 3288 fParseAllInput = value; |
3288 } | 3289 } |
3289 #endif | 3290 #endif |
3290 | 3291 |
3291 U_NAMESPACE_END | 3292 U_NAMESPACE_END |
3292 | 3293 |
3293 #endif /* #if !UCONFIG_NO_FORMATTING */ | 3294 #endif /* #if !UCONFIG_NO_FORMATTING */ |
3294 | 3295 |
3295 //eof | 3296 //eof |
OLD | NEW |