2017-01-20 00:20:31 +00:00
|
|
|
// © 2016 and later: Unicode, Inc. and others.
|
2016-06-15 18:58:17 +00:00
|
|
|
// License & terms of use: http://www.unicode.org/copyright.html
|
2003-07-12 00:23:05 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
2016-05-31 21:45:07 +00:00
|
|
|
* Copyright (c) 2002-2016, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
2003-07-12 00:23:05 +00:00
|
|
|
**********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _UCURR_IMP_H_
|
|
|
|
#define _UCURR_IMP_H_
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
2006-09-04 17:01:02 +00:00
|
|
|
#include "unicode/unistr.h"
|
|
|
|
#include "unicode/parsepos.h"
|
2003-07-12 00:23:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal method. Given a currency ISO code and a locale, return
|
|
|
|
* the "static" currency name. This is usually the same as the
|
|
|
|
* UCURR_SYMBOL_NAME, but if the latter is a choice format, then the
|
|
|
|
* format is applied to the number 2.0 (to yield the more common
|
|
|
|
* plural) to return a static name.
|
|
|
|
*
|
|
|
|
* This is used for backward compatibility with old currency logic in
|
|
|
|
* DecimalFormat and DecimalFormatSymbols.
|
|
|
|
*/
|
2016-01-27 17:22:26 +00:00
|
|
|
U_CAPI void
|
2003-07-12 00:23:05 +00:00
|
|
|
uprv_getStaticCurrencyName(const UChar* iso, const char* loc,
|
2011-07-06 04:03:35 +00:00
|
|
|
icu::UnicodeString& result, UErrorCode& ec);
|
2006-09-04 17:01:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempt to parse the given string as a currency, either as a
|
|
|
|
* display name in the given locale, or as a 3-letter ISO 4217
|
|
|
|
* code. If multiple display names match, then the longest one is
|
|
|
|
* selected. If both a display name and a 3-letter ISO code
|
|
|
|
* match, then the display name is preferred, unless it's length
|
|
|
|
* is less than 3.
|
|
|
|
*
|
|
|
|
* @param locale the locale of the display names to match
|
|
|
|
* @param text the text to parse
|
|
|
|
* @param pos input-output position; on input, the position within
|
|
|
|
* text to match; must have 0 <= pos.getIndex() < text.length();
|
|
|
|
* on output, the position after the last matched character. If
|
|
|
|
* the parse fails, the position in unchanged upon output.
|
2009-03-10 20:53:27 +00:00
|
|
|
* @param type currency type to parse against, LONG_NAME only or not
|
2006-09-04 17:01:02 +00:00
|
|
|
* @return the ISO 4217 code, as a string, of the best match, or
|
|
|
|
* null if there is no match
|
|
|
|
*
|
|
|
|
* @internal
|
|
|
|
*/
|
2016-01-27 17:22:26 +00:00
|
|
|
U_CAPI void
|
2006-09-04 17:01:02 +00:00
|
|
|
uprv_parseCurrency(const char* locale,
|
2011-07-06 04:03:35 +00:00
|
|
|
const icu::UnicodeString& text,
|
|
|
|
icu::ParsePosition& pos,
|
2009-03-10 20:53:27 +00:00
|
|
|
int8_t type,
|
2006-09-04 17:01:02 +00:00
|
|
|
UChar* result,
|
|
|
|
UErrorCode& ec);
|
2003-07-12 00:23:05 +00:00
|
|
|
|
|
|
|
#endif /* #ifndef _UCURR_IMP_H_ */
|
|
|
|
|
|
|
|
//eof
|