]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/ucurrimp.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (c) 2002-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
13 #include "unicode/utypes.h"
14 #include "unicode/unistr.h"
15 #include "unicode/parsepos.h"
16 #include "unicode/uniset.h"
19 * Internal method. Given a currency ISO code and a locale, return
20 * the "static" currency name. This is usually the same as the
21 * UCURR_SYMBOL_NAME, but if the latter is a choice format, then the
22 * format is applied to the number 2.0 (to yield the more common
23 * plural) to return a static name.
25 * This is used for backward compatibility with old currency logic in
26 * DecimalFormat and DecimalFormatSymbols.
29 uprv_getStaticCurrencyName(const UChar
* iso
, const char* loc
,
30 icu::UnicodeString
& result
, UErrorCode
& ec
);
33 * Attempt to parse the given string as a currency, either as a
34 * display name in the given locale, or as a 3-letter ISO 4217
35 * code. If multiple display names match, then the longest one is
36 * selected. If both a display name and a 3-letter ISO code
37 * match, then the display name is preferred, unless it's length
40 * The parameters must not be NULL.
42 * @param locale the locale of the display names to match
43 * @param text the text to parse
44 * @param pos input-output position; on input, the position within
45 * text to match; must have 0 <= pos.getIndex() < text.length();
46 * on output, the position after the last matched character. If
47 * the parse fails, the position in unchanged upon output.
48 * @param type currency type to parse against, LONG_NAME only or not
49 * @param partialMatchLen The length of the longest matching prefix;
50 * this may be nonzero even if no full currency was matched.
51 * @return the ISO 4217 code, as a string, of the best match, or
52 * null if there is no match
57 uprv_parseCurrency(const char* locale
,
58 const icu::UnicodeString
& text
,
59 icu::ParsePosition
& pos
,
61 int32_t* partialMatchLen
,
66 * Puts all possible first-characters of a currency into the
67 * specified UnicodeSet.
69 * @param locale the locale of the display names of interest
70 * @param result the UnicodeSet to which to add the starting characters
72 void uprv_currencyLeads(const char* locale
, icu::UnicodeSet
& result
, UErrorCode
& ec
);
76 #endif /* #ifndef _UCURR_IMP_H_ */