Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | ********************************************************************** |
michael@0 | 3 | * Copyright (c) 2002-2011, International Business Machines |
michael@0 | 4 | * Corporation and others. All Rights Reserved. |
michael@0 | 5 | ********************************************************************** |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef _UCURR_IMP_H_ |
michael@0 | 9 | #define _UCURR_IMP_H_ |
michael@0 | 10 | |
michael@0 | 11 | #include "unicode/utypes.h" |
michael@0 | 12 | #include "unicode/unistr.h" |
michael@0 | 13 | #include "unicode/parsepos.h" |
michael@0 | 14 | |
michael@0 | 15 | /** |
michael@0 | 16 | * Internal method. Given a currency ISO code and a locale, return |
michael@0 | 17 | * the "static" currency name. This is usually the same as the |
michael@0 | 18 | * UCURR_SYMBOL_NAME, but if the latter is a choice format, then the |
michael@0 | 19 | * format is applied to the number 2.0 (to yield the more common |
michael@0 | 20 | * plural) to return a static name. |
michael@0 | 21 | * |
michael@0 | 22 | * This is used for backward compatibility with old currency logic in |
michael@0 | 23 | * DecimalFormat and DecimalFormatSymbols. |
michael@0 | 24 | */ |
michael@0 | 25 | U_CFUNC void |
michael@0 | 26 | uprv_getStaticCurrencyName(const UChar* iso, const char* loc, |
michael@0 | 27 | icu::UnicodeString& result, UErrorCode& ec); |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | * Attempt to parse the given string as a currency, either as a |
michael@0 | 31 | * display name in the given locale, or as a 3-letter ISO 4217 |
michael@0 | 32 | * code. If multiple display names match, then the longest one is |
michael@0 | 33 | * selected. If both a display name and a 3-letter ISO code |
michael@0 | 34 | * match, then the display name is preferred, unless it's length |
michael@0 | 35 | * is less than 3. |
michael@0 | 36 | * |
michael@0 | 37 | * @param locale the locale of the display names to match |
michael@0 | 38 | * @param text the text to parse |
michael@0 | 39 | * @param pos input-output position; on input, the position within |
michael@0 | 40 | * text to match; must have 0 <= pos.getIndex() < text.length(); |
michael@0 | 41 | * on output, the position after the last matched character. If |
michael@0 | 42 | * the parse fails, the position in unchanged upon output. |
michael@0 | 43 | * @param type currency type to parse against, LONG_NAME only or not |
michael@0 | 44 | * @return the ISO 4217 code, as a string, of the best match, or |
michael@0 | 45 | * null if there is no match |
michael@0 | 46 | * |
michael@0 | 47 | * @internal |
michael@0 | 48 | */ |
michael@0 | 49 | U_CFUNC void |
michael@0 | 50 | uprv_parseCurrency(const char* locale, |
michael@0 | 51 | const icu::UnicodeString& text, |
michael@0 | 52 | icu::ParsePosition& pos, |
michael@0 | 53 | int8_t type, |
michael@0 | 54 | UChar* result, |
michael@0 | 55 | UErrorCode& ec); |
michael@0 | 56 | |
michael@0 | 57 | #endif /* #ifndef _UCURR_IMP_H_ */ |
michael@0 | 58 | |
michael@0 | 59 | //eof |