intl/icu/source/i18n/ucurrimp.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/ucurrimp.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/*
     1.5 +**********************************************************************
     1.6 +* Copyright (c) 2002-2011, International Business Machines
     1.7 +* Corporation and others.  All Rights Reserved.
     1.8 +**********************************************************************
     1.9 +*/
    1.10 +
    1.11 +#ifndef _UCURR_IMP_H_
    1.12 +#define _UCURR_IMP_H_
    1.13 +
    1.14 +#include "unicode/utypes.h"
    1.15 +#include "unicode/unistr.h"
    1.16 +#include "unicode/parsepos.h"
    1.17 +
    1.18 +/**
    1.19 + * Internal method.  Given a currency ISO code and a locale, return
    1.20 + * the "static" currency name.  This is usually the same as the
    1.21 + * UCURR_SYMBOL_NAME, but if the latter is a choice format, then the
    1.22 + * format is applied to the number 2.0 (to yield the more common
    1.23 + * plural) to return a static name.
    1.24 + *
    1.25 + * This is used for backward compatibility with old currency logic in
    1.26 + * DecimalFormat and DecimalFormatSymbols.
    1.27 + */
    1.28 +U_CFUNC void
    1.29 +uprv_getStaticCurrencyName(const UChar* iso, const char* loc,
    1.30 +                           icu::UnicodeString& result, UErrorCode& ec);
    1.31 +
    1.32 +/**
    1.33 + * Attempt to parse the given string as a currency, either as a
    1.34 + * display name in the given locale, or as a 3-letter ISO 4217
    1.35 + * code.  If multiple display names match, then the longest one is
    1.36 + * selected.  If both a display name and a 3-letter ISO code
    1.37 + * match, then the display name is preferred, unless it's length
    1.38 + * is less than 3.
    1.39 + *
    1.40 + * @param locale the locale of the display names to match
    1.41 + * @param text the text to parse
    1.42 + * @param pos input-output position; on input, the position within
    1.43 + * text to match; must have 0 <= pos.getIndex() < text.length();
    1.44 + * on output, the position after the last matched character. If
    1.45 + * the parse fails, the position in unchanged upon output.
    1.46 + * @param type currency type to parse against, LONG_NAME only or not
    1.47 + * @return the ISO 4217 code, as a string, of the best match, or
    1.48 + * null if there is no match
    1.49 + *
    1.50 + * @internal
    1.51 + */
    1.52 +U_CFUNC void
    1.53 +uprv_parseCurrency(const char* locale,
    1.54 +                   const icu::UnicodeString& text,
    1.55 +                   icu::ParsePosition& pos,
    1.56 +                   int8_t type,
    1.57 +                   UChar* result,
    1.58 +                   UErrorCode& ec);
    1.59 +
    1.60 +#endif /* #ifndef _UCURR_IMP_H_ */
    1.61 +
    1.62 +//eof

mercurial