2 **********************************************************************
3 * Copyright (c) 2002-2009, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
11 #include "unicode/utypes.h"
12 #include "unicode/unistr.h"
13 #include "unicode/parsepos.h"
16 * Internal method. Given a currency ISO code and a locale, return
17 * the "static" currency name. This is usually the same as the
18 * UCURR_SYMBOL_NAME, but if the latter is a choice format, then the
19 * format is applied to the number 2.0 (to yield the more common
20 * plural) to return a static name.
22 * This is used for backward compatibility with old currency logic in
23 * DecimalFormat and DecimalFormatSymbols.
26 uprv_getStaticCurrencyName(const UChar
* iso
, const char* loc
,
27 U_NAMESPACE_QUALIFIER UnicodeString
& result
, UErrorCode
& ec
);
30 * Attempt to parse the given string as a currency, either as a
31 * display name in the given locale, or as a 3-letter ISO 4217
32 * code. If multiple display names match, then the longest one is
33 * selected. If both a display name and a 3-letter ISO code
34 * match, then the display name is preferred, unless it's length
37 * @param locale the locale of the display names to match
38 * @param text the text to parse
39 * @param pos input-output position; on input, the position within
40 * text to match; must have 0 <= pos.getIndex() < text.length();
41 * on output, the position after the last matched character. If
42 * the parse fails, the position in unchanged upon output.
43 * @param type currency type to parse against, LONG_NAME only or not
44 * @return the ISO 4217 code, as a string, of the best match, or
45 * null if there is no match
50 uprv_parseCurrency(const char* locale
,
51 const U_NAMESPACE_QUALIFIER UnicodeString
& text
,
52 U_NAMESPACE_QUALIFIER ParsePosition
& pos
,
57 #endif /* #ifndef _UCURR_IMP_H_ */