michael@0: /* michael@0: ********************************************************************** michael@0: * Copyright (c) 2002-2011, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: ********************************************************************** michael@0: */ michael@0: michael@0: #ifndef _UCURR_IMP_H_ michael@0: #define _UCURR_IMP_H_ michael@0: michael@0: #include "unicode/utypes.h" michael@0: #include "unicode/unistr.h" michael@0: #include "unicode/parsepos.h" michael@0: michael@0: /** michael@0: * Internal method. Given a currency ISO code and a locale, return michael@0: * the "static" currency name. This is usually the same as the michael@0: * UCURR_SYMBOL_NAME, but if the latter is a choice format, then the michael@0: * format is applied to the number 2.0 (to yield the more common michael@0: * plural) to return a static name. michael@0: * michael@0: * This is used for backward compatibility with old currency logic in michael@0: * DecimalFormat and DecimalFormatSymbols. michael@0: */ michael@0: U_CFUNC void michael@0: uprv_getStaticCurrencyName(const UChar* iso, const char* loc, michael@0: icu::UnicodeString& result, UErrorCode& ec); michael@0: michael@0: /** michael@0: * Attempt to parse the given string as a currency, either as a michael@0: * display name in the given locale, or as a 3-letter ISO 4217 michael@0: * code. If multiple display names match, then the longest one is michael@0: * selected. If both a display name and a 3-letter ISO code michael@0: * match, then the display name is preferred, unless it's length michael@0: * is less than 3. michael@0: * michael@0: * @param locale the locale of the display names to match michael@0: * @param text the text to parse michael@0: * @param pos input-output position; on input, the position within michael@0: * text to match; must have 0 <= pos.getIndex() < text.length(); michael@0: * on output, the position after the last matched character. If michael@0: * the parse fails, the position in unchanged upon output. michael@0: * @param type currency type to parse against, LONG_NAME only or not michael@0: * @return the ISO 4217 code, as a string, of the best match, or michael@0: * null if there is no match michael@0: * michael@0: * @internal michael@0: */ michael@0: U_CFUNC void michael@0: uprv_parseCurrency(const char* locale, michael@0: const icu::UnicodeString& text, michael@0: icu::ParsePosition& pos, michael@0: int8_t type, michael@0: UChar* result, michael@0: UErrorCode& ec); michael@0: michael@0: #endif /* #ifndef _UCURR_IMP_H_ */ michael@0: michael@0: //eof