]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/ucurrimp.h
ICU-511.32.tar.gz
[apple/icu.git] / icuSources / i18n / ucurrimp.h
CommitLineData
374ca955
A
1/*
2**********************************************************************
4388f060 3* Copyright (c) 2002-2011, International Business Machines
374ca955
A
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"
46f4442e
A
12#include "unicode/unistr.h"
13#include "unicode/parsepos.h"
374ca955
A
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 */
46f4442e 25U_CFUNC void
374ca955 26uprv_getStaticCurrencyName(const UChar* iso, const char* loc,
4388f060 27 icu::UnicodeString& result, UErrorCode& ec);
46f4442e
A
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.
729e4ab9 43 * @param type currency type to parse against, LONG_NAME only or not
46f4442e
A
44 * @return the ISO 4217 code, as a string, of the best match, or
45 * null if there is no match
46 *
47 * @internal
48 */
49U_CFUNC void
50uprv_parseCurrency(const char* locale,
4388f060
A
51 const icu::UnicodeString& text,
52 icu::ParsePosition& pos,
729e4ab9 53 int8_t type,
46f4442e
A
54 UChar* result,
55 UErrorCode& ec);
374ca955
A
56
57#endif /* #ifndef _UCURR_IMP_H_ */
58
59//eof