• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 **********************************************************************
3 * Copyright (c) 2002-2006, International Business Machines
4 * Corporation and others.  All Rights Reserved.
5 **********************************************************************
6 */
7 
8 #ifndef _UCURR_IMP_H_
9 #define _UCURR_IMP_H_
10 
11 #include "unicode/utypes.h"
12 #include "unicode/unistr.h"
13 #include "unicode/parsepos.h"
14 
15 /**
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.
21  *
22  * This is used for backward compatibility with old currency logic in
23  * DecimalFormat and DecimalFormatSymbols.
24  */
25 U_CAPI void
26 uprv_getStaticCurrencyName(const UChar* iso, const char* loc,
27                            U_NAMESPACE_QUALIFIER UnicodeString& result, UErrorCode& ec);
28 
29 /**
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
35  * is less than 3.
36  *
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  * @return the ISO 4217 code, as a string, of the best match, or
44  * null if there is no match
45  *
46  * @internal
47  */
48 U_CAPI void
49 uprv_parseCurrency(const char* locale,
50                    const U_NAMESPACE_QUALIFIER UnicodeString& text,
51                    U_NAMESPACE_QUALIFIER ParsePosition& pos,
52                    UChar* result,
53                    UErrorCode& ec);
54 
55 #endif /* #ifndef _UCURR_IMP_H_ */
56 
57 //eof
58