]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
374ca955 A |
3 | /* |
4 | ********************************************************************** | |
2ca993e8 | 5 | * Copyright (c) 2002-2016, International Business Machines |
374ca955 A |
6 | * Corporation and others. All Rights Reserved. |
7 | ********************************************************************** | |
8 | */ | |
9 | ||
10 | #ifndef _UCURR_IMP_H_ | |
11 | #define _UCURR_IMP_H_ | |
12 | ||
13 | #include "unicode/utypes.h" | |
46f4442e A |
14 | #include "unicode/unistr.h" |
15 | #include "unicode/parsepos.h" | |
374ca955 A |
16 | |
17 | /** | |
18 | * Internal method. Given a currency ISO code and a locale, return | |
19 | * the "static" currency name. This is usually the same as the | |
20 | * UCURR_SYMBOL_NAME, but if the latter is a choice format, then the | |
21 | * format is applied to the number 2.0 (to yield the more common | |
22 | * plural) to return a static name. | |
23 | * | |
24 | * This is used for backward compatibility with old currency logic in | |
25 | * DecimalFormat and DecimalFormatSymbols. | |
26 | */ | |
2ca993e8 | 27 | U_CAPI void |
374ca955 | 28 | uprv_getStaticCurrencyName(const UChar* iso, const char* loc, |
4388f060 | 29 | icu::UnicodeString& result, UErrorCode& ec); |
46f4442e A |
30 | |
31 | /** | |
32 | * Attempt to parse the given string as a currency, either as a | |
33 | * display name in the given locale, or as a 3-letter ISO 4217 | |
34 | * code. If multiple display names match, then the longest one is | |
35 | * selected. If both a display name and a 3-letter ISO code | |
36 | * match, then the display name is preferred, unless it's length | |
37 | * is less than 3. | |
38 | * | |
39 | * @param locale the locale of the display names to match | |
40 | * @param text the text to parse | |
41 | * @param pos input-output position; on input, the position within | |
42 | * text to match; must have 0 <= pos.getIndex() < text.length(); | |
43 | * on output, the position after the last matched character. If | |
44 | * the parse fails, the position in unchanged upon output. | |
729e4ab9 | 45 | * @param type currency type to parse against, LONG_NAME only or not |
46f4442e A |
46 | * @return the ISO 4217 code, as a string, of the best match, or |
47 | * null if there is no match | |
48 | * | |
49 | * @internal | |
50 | */ | |
2ca993e8 | 51 | U_CAPI void |
46f4442e | 52 | uprv_parseCurrency(const char* locale, |
4388f060 A |
53 | const icu::UnicodeString& text, |
54 | icu::ParsePosition& pos, | |
729e4ab9 | 55 | int8_t type, |
46f4442e A |
56 | UChar* result, |
57 | UErrorCode& ec); | |
374ca955 A |
58 | |
59 | #endif /* #ifndef _UCURR_IMP_H_ */ | |
60 | ||
61 | //eof |