404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.191.162.61: ~ $
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
* Copyright (c) 2002-2016, International Business Machines
* Corporation and others.  All Rights Reserved.
**********************************************************************
*/
#ifndef _UCURR_H_
#define _UCURR_H_

#include "unicode/utypes.h"
#include "unicode/uenum.h"

/**
 * \file 
 * \brief C API: Encapsulates information about a currency.
 *
 * The ucurr API encapsulates information about a currency, as defined by
 * ISO 4217.  A currency is represented by a 3-character string
 * containing its ISO 4217 code.  This API can return various data
 * necessary the proper display of a currency:
 *
 * <ul><li>A display symbol, for a specific locale
 * <li>The number of fraction digits to display
 * <li>A rounding increment
 * </ul>
 *
 * The <tt>DecimalFormat</tt> class uses these data to display
 * currencies.
 * @author Alan Liu
 * @since ICU 2.2
 */

#if !UCONFIG_NO_FORMATTING

/**
 * Currency Usage used for Decimal Format
 * @stable ICU 54
 */
enum UCurrencyUsage {
    /**
     * a setting to specify currency usage which determines currency digit
     * and rounding for standard usage, for example: "50.00 NT$"
     * used as DEFAULT value
     * @stable ICU 54
     */
    UCURR_USAGE_STANDARD=0,
    /**
     * a setting to specify currency usage which determines currency digit
     * and rounding for cash usage, for example: "50 NT$"
     * @stable ICU 54
     */
    UCURR_USAGE_CASH=1,
#ifndef U_HIDE_DEPRECATED_API
    /**
     * One higher than the last enum UCurrencyUsage constant.
     * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
     */
    UCURR_USAGE_COUNT=2
#endif  // U_HIDE_DEPRECATED_API
};
/** Currency Usage used for Decimal Format */
typedef enum UCurrencyUsage UCurrencyUsage; 

/**
 * Finds a currency code for the given locale.
 * @param locale the locale for which to retrieve a currency code. 
 *               Currency can be specified by the "currency" keyword
 *               in which case it overrides the default currency code
 * @param buff   fill in buffer. Can be NULL for preflighting.
 * @param buffCapacity capacity of the fill in buffer. Can be 0 for
 *               preflighting. If it is non-zero, the buff parameter
 *               must not be NULL.
 * @param ec error code
 * @return length of the currency string. It should always be 3. If 0,
 *                currency couldn't be found or the input values are 
 *                invalid. 
 * @stable ICU 2.8
 */
U_STABLE int32_t U_EXPORT2
ucurr_forLocale(const char* locale,
                UChar* buff,
                int32_t buffCapacity,
                UErrorCode* ec);

/**
 * Selector constants for ucurr_getName().
 *
 * @see ucurr_getName
 * @stable ICU 2.6
 */
typedef enum UCurrNameStyle {
    /**
     * Selector for ucurr_getName indicating a symbolic name for a
     * currency, such as "$" for USD.
     * @stable ICU 2.6
     */
    UCURR_SYMBOL_NAME,

    /**
     * Selector for ucurr_getName indicating the long name for a
     * currency, such as "US Dollar" for USD.
     * @stable ICU 2.6
     */
    UCURR_LONG_NAME,

    /**
     * Selector for getName() indicating the narrow currency symbol.
     * The narrow currency symbol is similar to the regular currency
     * symbol, but it always takes the shortest form: for example,
     * "$" instead of "US$" for USD in en-CA.
     *
     * @stable ICU 61
     */
    UCURR_NARROW_SYMBOL_NAME
} UCurrNameStyle;

#if !UCONFIG_NO_SERVICE
/**
 * @stable ICU 2.6
 */
typedef const void* UCurrRegistryKey;

/**
 * Register an (existing) ISO 4217 currency code for the given locale.
 * Only the country code and the two variants EURO and PRE_EURO are
 * recognized.
 * @param isoCode the three-letter ISO 4217 currency code
 * @param locale  the locale for which to register this currency code
 * @param status the in/out status code
 * @return a registry key that can be used to unregister this currency code, or NULL
 * if there was an error.
 * @stable ICU 2.6
 */
U_STABLE UCurrRegistryKey U_EXPORT2
ucurr_register(const UChar* isoCode, 
                   const char* locale,  
                   UErrorCode* status);
/**
 * Unregister the previously-registered currency definitions using the
 * URegistryKey returned from ucurr_register.  Key becomes invalid after
 * a successful call and should not be used again.  Any currency 
 * that might have been hidden by the original ucurr_register call is 
 * restored.
 * @param key the registry key returned by a previous call to ucurr_register
 * @param status the in/out status code, no special meanings are assigned
 * @return TRUE if the currency for this key was successfully unregistered
 * @stable ICU 2.6
 */
U_STABLE UBool U_EXPORT2
ucurr_unregister(UCurrRegistryKey key, UErrorCode* status);
#endif /* UCONFIG_NO_SERVICE */

/**
 * Returns the display name for the given currency in the
 * given locale.  For example, the display name for the USD
 * currency object in the en_US locale is "$".
 * @param currency null-terminated 3-letter ISO 4217 code
 * @param locale locale in which to display currency
 * @param nameStyle selector for which kind of name to return
 * @param isChoiceFormat always set to FALSE, or can be NULL;
 *     display names are static strings;
 *     since ICU 4.4, ChoiceFormat patterns are no longer supported
 * @param len fill-in parameter to receive length of result
 * @param ec error code
 * @return pointer to display string of 'len' UChars.  If the resource
 * data contains no entry for 'currency', then 'currency' itself is
 * returned.
 * @stable ICU 2.6
 */
U_STABLE const UChar* U_EXPORT2
ucurr_getName(const UChar* currency,
              const char* locale,
              UCurrNameStyle nameStyle,
              UBool* isChoiceFormat,
              int32_t* len,
              UErrorCode* ec);

/**
 * Returns the plural name for the given currency in the
 * given locale.  For example, the plural name for the USD
 * currency object in the en_US locale is "US dollar" or "US dollars".
 * @param currency null-terminated 3-letter ISO 4217 code
 * @param locale locale in which to display currency
 * @param isChoiceFormat always set to FALSE, or can be NULL;
 *     display names are static strings;
 *     since ICU 4.4, ChoiceFormat patterns are no longer supported
 * @param pluralCount plural count
 * @param len fill-in parameter to receive length of result
 * @param ec error code
 * @return pointer to display string of 'len' UChars.  If the resource
 * data contains no entry for 'currency', then 'currency' itself is
 * returned.
 * @stable ICU 4.2
 */
U_STABLE const UChar* U_EXPORT2
ucurr_getPluralName(const UChar* currency,
                    const char* locale,
                    UBool* isChoiceFormat,
                    const char* pluralCount,
                    int32_t* len,
                    UErrorCode* ec);

/**
 * Returns the number of the number of fraction digits that should
 * be displayed for the given currency.
 * This is equivalent to ucurr_getDefaultFractionDigitsForUsage(currency,UCURR_USAGE_STANDARD,ec);
 *
 * Important: The number of fraction digits for a given currency is NOT
 * guaranteed to be constant across versions of ICU or CLDR. For example,
 * do NOT use this value as a mechanism for deciding the magnitude used
 * to store currency values in a database. You should use this value for
 * display purposes only.
 *
 * @param currency null-terminated 3-letter ISO 4217 code
 * @param ec input-output error code
 * @return a non-negative number of fraction digits to be
 * displayed, or 0 if there is an error
 * @stable ICU 3.0
 */
U_STABLE int32_t U_EXPORT2
ucurr_getDefaultFractionDigits(const UChar* currency,
                               UErrorCode* ec);

/**
 * Returns the number of the number of fraction digits that should
 * be displayed for the given currency with usage.
 *
 * Important: The number of fraction digits for a given currency is NOT
 * guaranteed to be constant across versions of ICU or CLDR. For example,
 * do NOT use this value as a mechanism for deciding the magnitude used
 * to store currency values in a database. You should use this value for
 * display purposes only.
 *
 * @param currency null-terminated 3-letter ISO 4217 code
 * @param usage enum usage for the currency
 * @param ec input-output error code
 * @return a non-negative number of fraction digits to be
 * displayed, or 0 if there is an error
 * @stable ICU 54
 */
U_STABLE int32_t U_EXPORT2
ucurr_getDefaultFractionDigitsForUsage(const UChar* currency, 
                                       const UCurrencyUsage usage,
                                       UErrorCode* ec);

/**
 * Returns the rounding increment for the given currency, or 0.0 if no
 * rounding is done by the currency.
 * This is equivalent to ucurr_getRoundingIncrementForUsage(currency,UCURR_USAGE_STANDARD,ec);
 * @param currency null-terminated 3-letter ISO 4217 code
 * @param ec input-output error code
 * @return the non-negative rounding increment, or 0.0 if none,
 * or 0.0 if there is an error
 * @stable ICU 3.0
 */
U_STABLE double U_EXPORT2
ucurr_getRoundingIncrement(const UChar* currency,
                           UErrorCode* ec);

/**
 * Returns the rounding increment for the given currency, or 0.0 if no
 * rounding is done by the currency given usage.
 * @param currency null-terminated 3-letter ISO 4217 code
 * @param usage enum usage for the currency
 * @param ec input-output error code
 * @return the non-negative rounding increment, or 0.0 if none,
 * or 0.0 if there is an error
 * @stable ICU 54
 */
U_STABLE double U_EXPORT2
ucurr_getRoundingIncrementForUsage(const UChar* currency,
                                   const UCurrencyUsage usage,
                                   UErrorCode* ec);

/**
 * Selector constants for ucurr_openCurrencies().
 *
 * @see ucurr_openCurrencies
 * @stable ICU 3.2
 */
typedef enum UCurrCurrencyType {
    /**
     * Select all ISO-4217 currency codes.
     * @stable ICU 3.2
     */
    UCURR_ALL = INT32_MAX,
    /**
     * Select only ISO-4217 commonly used currency codes.
     * These currencies can be found in common use, and they usually have
     * bank notes or coins associated with the currency code.
     * This does not include fund codes, precious metals and other
     * various ISO-4217 codes limited to special financial products.
     * @stable ICU 3.2
     */
    UCURR_COMMON = 1,
    /**
     * Select ISO-4217 uncommon currency codes.
     * These codes respresent fund codes, precious metals and other
     * various ISO-4217 codes limited to special financial products.
     * A fund code is a monetary resource associated with a currency.
     * @stable ICU 3.2
     */
    UCURR_UNCOMMON = 2,
    /**
     * Select only deprecated ISO-4217 codes.
     * These codes are no longer in general public use.
     * @stable ICU 3.2
     */
    UCURR_DEPRECATED = 4,
    /**
     * Select only non-deprecated ISO-4217 codes.
     * These codes are in general public use.
     * @stable ICU 3.2
     */
    UCURR_NON_DEPRECATED = 8
} UCurrCurrencyType;

/**
 * Provides a UEnumeration object for listing ISO-4217 codes.
 * @param currType You can use one of several UCurrCurrencyType values for this
 *      variable. You can also | (or) them together to get a specific list of
 *      currencies. Most people will want to use the (UCURR_COMMON|UCURR_NON_DEPRECATED) value to
 *      get a list of current currencies.
 * @param pErrorCode Error code
 * @stable ICU 3.2
 */
U_STABLE UEnumeration * U_EXPORT2
ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode);

/**
  * Queries if the given ISO 4217 3-letter code is available on the specified date range. 
  * 
  * Note: For checking availability of a currency on a specific date, specify the date on both 'from' and 'to' 
  * 
  * When 'from' is U_DATE_MIN and 'to' is U_DATE_MAX, this method checks if the specified currency is available any time. 
  * If 'from' and 'to' are same UDate value, this method checks if the specified currency is available on that date.
  * 
  * @param isoCode 
  *            The ISO 4217 3-letter code. 
  * 
  * @param from 
  *            The lower bound of the date range, inclusive. When 'from' is U_DATE_MIN, check the availability 
  *            of the currency any date before 'to' 
  * 
  * @param to 
  *            The upper bound of the date range, inclusive. When 'to' is U_DATE_MAX, check the availability of 
  *            the currency any date after 'from' 
  * 
  * @param errorCode 
  *            ICU error code 
   * 
  * @return TRUE if the given ISO 4217 3-letter code is supported on the specified date range. 
  * 
  * @stable ICU 4.8 
  */ 
U_STABLE UBool U_EXPORT2
ucurr_isAvailable(const UChar* isoCode, 
             UDate from, 
             UDate to, 
             UErrorCode* errorCode);

/** 
 * Finds the number of valid currency codes for the
 * given locale and date.
 * @param locale the locale for which to retrieve the
 *               currency count.
 * @param date   the date for which to retrieve the
 *               currency count for the given locale.
 * @param ec     error code
 * @return       the number of currency codes for the
 *               given locale and date.  If 0, currency
 *               codes couldn't be found for the input
 *               values are invalid.
 * @stable ICU 4.0
 */
U_STABLE int32_t U_EXPORT2
ucurr_countCurrencies(const char* locale, 
                 UDate date, 
                 UErrorCode* ec); 

/** 
 * Finds a currency code for the given locale and date 
 * @param locale the locale for which to retrieve a currency code.  
 *               Currency can be specified by the "currency" keyword 
 *               in which case it overrides the default currency code 
 * @param date   the date for which to retrieve a currency code for 
 *               the given locale. 
 * @param index  the index within the available list of currency codes
 *               for the given locale on the given date.
 * @param buff   fill in buffer. Can be NULL for preflighting. 
 * @param buffCapacity capacity of the fill in buffer. Can be 0 for 
 *               preflighting. If it is non-zero, the buff parameter 
 *               must not be NULL. 
 * @param ec     error code 
 * @return       length of the currency string. It should always be 3. 
 *               If 0, currency couldn't be found or the input values are  
 *               invalid.  
 * @stable ICU 4.0 
 */ 
U_STABLE int32_t U_EXPORT2 
ucurr_forLocaleAndDate(const char* locale, 
                UDate date, 
                int32_t index,
                UChar* buff, 
                int32_t buffCapacity, 
                UErrorCode* ec); 

/**
 * Given a key and a locale, returns an array of string values in a preferred
 * order that would make a difference. These are all and only those values where
 * the open (creation) of the service with the locale formed from the input locale
 * plus input keyword and that value has different behavior than creation with the
 * input locale alone.
 * @param key           one of the keys supported by this service.  For now, only
 *                      "currency" is supported.
 * @param locale        the locale
 * @param commonlyUsed  if set to true it will return only commonly used values
 *                      with the given locale in preferred order.  Otherwise,
 *                      it will return all the available values for the locale.
 * @param status error status
 * @return a string enumeration over keyword values for the given key and the locale.
 * @stable ICU 4.2
 */
U_STABLE UEnumeration* U_EXPORT2
ucurr_getKeywordValuesForLocale(const char* key,
                                const char* locale,
                                UBool commonlyUsed,
                                UErrorCode* status);

/**
 * Returns the ISO 4217 numeric code for the currency.
 * <p>Note: If the ISO 4217 numeric code is not assigned for the currency or
 * the currency is unknown, this function returns 0.
 *
 * @param currency null-terminated 3-letter ISO 4217 code
 * @return The ISO 4217 numeric code of the currency
 * @stable ICU 49
 */
U_STABLE int32_t U_EXPORT2
ucurr_getNumericCode(const UChar* currency);

#endif /* #if !UCONFIG_NO_FORMATTING */

#endif

Filemanager

Name Type Size Permission Actions
alphaindex.h File 26.48 KB 0644
appendable.h File 8.49 KB 0644
basictz.h File 9.15 KB 0644
brkiter.h File 27.8 KB 0644
bytestream.h File 9.6 KB 0644
bytestrie.h File 20.77 KB 0644
bytestriebuilder.h File 7.08 KB 0644
calendar.h File 105.74 KB 0644
caniter.h File 7.43 KB 0644
casemap.h File 25.33 KB 0644
char16ptr.h File 7.22 KB 0644
chariter.h File 24.05 KB 0644
choicfmt.h File 23.91 KB 0644
coleitr.h File 13.76 KB 0644
coll.h File 56.23 KB 0644
compactdecimalformat.h File 6.88 KB 0644
curramt.h File 3.76 KB 0644
currpinf.h File 7.3 KB 0644
currunit.h File 4.05 KB 0644
datefmt.h File 40.67 KB 0644
dbbi.h File 1.19 KB 0644
dcfmtsym.h File 20.13 KB 0644
decimfmt.h File 87.38 KB 0644
docmain.h File 6.97 KB 0644
dtfmtsym.h File 37.7 KB 0644
dtintrv.h File 3.84 KB 0644
dtitvfmt.h File 46.63 KB 0644
dtitvinf.h File 18.51 KB 0644
dtptngen.h File 25.08 KB 0644
dtrule.h File 8.68 KB 0644
edits.h File 20.74 KB 0644
enumset.h File 2.08 KB 0644
errorcode.h File 4.84 KB 0644
fieldpos.h File 8.69 KB 0644
filteredbrk.h File 5.37 KB 0644
fmtable.h File 24.42 KB 0644
format.h File 12.5 KB 0644
formattedvalue.h File 10.27 KB 0644
fpositer.h File 3.04 KB 0644
gender.h File 3.33 KB 0644
gregocal.h File 31.71 KB 0644
icudataver.h File 1.03 KB 0644
icuplug.h File 11.88 KB 0644
idna.h File 12.7 KB 0644
listformatter.h File 9.47 KB 0644
localebuilder.h File 11.27 KB 0644
localematcher.h File 22.5 KB 0644
localpointer.h File 19.69 KB 0644
locdspnm.h File 7.12 KB 0644
locid.h File 47.4 KB 0644
measfmt.h File 11.33 KB 0644
measunit.h File 93.31 KB 0644
measure.h File 4.32 KB 0644
messagepattern.h File 33.71 KB 0644
msgfmt.h File 44.11 KB 0644
normalizer2.h File 34.03 KB 0644
normlzr.h File 30.94 KB 0644
nounit.h File 2.69 KB 0644
numberformatter.h File 86.31 KB 0644
numberrangeformatter.h File 30.14 KB 0644
numfmt.h File 49.81 KB 0644
numsys.h File 7.19 KB 0644
parseerr.h File 3.08 KB 0644
parsepos.h File 5.56 KB 0644
platform.h File 28.08 KB 0644
plurfmt.h File 25.2 KB 0644
plurrule.h File 18.39 KB 0644
ptypes.h File 3.49 KB 0644
putil.h File 6.33 KB 0644
rbbi.h File 26.58 KB 0644
rbnf.h File 48.73 KB 0644
rbtz.h File 15.6 KB 0644
regex.h File 84.36 KB 0644
region.h File 9.18 KB 0644
reldatefmt.h File 22.62 KB 0644
rep.h File 9.37 KB 0644
resbund.h File 18.07 KB 0644
schriter.h File 6.32 KB 0644
scientificnumberformatter.h File 6.4 KB 0644
search.h File 22.22 KB 0644
selfmt.h File 14.3 KB 0644
simpleformatter.h File 12.59 KB 0644
simpletz.h File 45.44 KB 0644
smpdtfmt.h File 70.97 KB 0644
sortkey.h File 11.18 KB 0644
std_string.h File 1.05 KB 0644
strenum.h File 9.92 KB 0644
stringoptions.h File 5.79 KB 0644
stringpiece.h File 7.38 KB 0644
stringtriebuilder.h File 15.33 KB 0644
stsearch.h File 21.3 KB 0644
symtable.h File 4.27 KB 0644
tblcoll.h File 36.61 KB 0644
timezone.h File 41.02 KB 0644
tmunit.h File 3.38 KB 0644
tmutamt.h File 4.9 KB 0644
tmutfmt.h File 7.85 KB 0644
translit.h File 65.82 KB 0644
tzfmt.h File 42.89 KB 0644
tznames.h File 16.85 KB 0644
tzrule.h File 35.37 KB 0644
tztrans.h File 6.12 KB 0644
ubidi.h File 89.56 KB 0644
ubiditransform.h File 12.65 KB 0644
ubrk.h File 23.97 KB 0644
ucal.h File 56.9 KB 0644
ucasemap.h File 15.18 KB 0644
ucat.h File 5.36 KB 0644
uchar.h File 140.56 KB 0644
ucharstrie.h File 22.58 KB 0644
ucharstriebuilder.h File 7.21 KB 0644
uchriter.h File 13.2 KB 0644
uclean.h File 11.21 KB 0644
ucnv.h File 83.09 KB 0644
ucnv_cb.h File 6.59 KB 0644
ucnv_err.h File 20.99 KB 0644
ucnvsel.h File 6.14 KB 0644
ucol.h File 61.46 KB 0644
ucoleitr.h File 9.46 KB 0644
uconfig.h File 12.07 KB 0644
ucpmap.h File 5.53 KB 0644
ucptrie.h File 22.46 KB 0644
ucsdet.h File 14.67 KB 0644
ucurr.h File 16.12 KB 0644
udat.h File 60.88 KB 0644
udata.h File 15.56 KB 0644
udateintervalformat.h File 10.03 KB 0644
udatpg.h File 26.01 KB 0644
udisplaycontext.h File 5.89 KB 0644
uenum.h File 7.78 KB 0644
ufieldpositer.h File 4.36 KB 0644
uformattable.h File 10.94 KB 0644
uformattedvalue.h File 12.14 KB 0644
ugender.h File 2 KB 0644
uidna.h File 33.37 KB 0644
uiter.h File 22.77 KB 0644
uldnames.h File 10.45 KB 0644
ulistformatter.h File 8.83 KB 0644
uloc.h File 52.54 KB 0644
ulocdata.h File 11.26 KB 0644
umachine.h File 14.53 KB 0644
umisc.h File 1.33 KB 0644
umsg.h File 24.23 KB 0644
umutablecptrie.h File 8.24 KB 0644
unifilt.h File 3.96 KB 0644
unifunct.h File 4.04 KB 0644
unimatch.h File 6.1 KB 0644
unirepl.h File 3.38 KB 0644
uniset.h File 64.9 KB 0644
unistr.h File 170.43 KB 0644
unorm.h File 20.52 KB 0644
unorm2.h File 24.66 KB 0644
unum.h File 53.62 KB 0644
unumberformatter.h File 25.36 KB 0644
unumsys.h File 7.21 KB 0644
uobject.h File 10.68 KB 0644
upluralrules.h File 7.88 KB 0644
uregex.h File 72.05 KB 0644
uregion.h File 9.84 KB 0644
ureldatefmt.h File 17.26 KB 0644
urename.h File 130.97 KB 0644
urep.h File 5.38 KB 0644
ures.h File 36.54 KB 0644
uscript.h File 26.87 KB 0644
usearch.h File 38.12 KB 0644
uset.h File 40 KB 0644
usetiter.h File 9.55 KB 0644
ushape.h File 18 KB 0644
uspoof.h File 65.9 KB 0644
usprep.h File 8.14 KB 0644
ustdio.h File 38.54 KB 0644
ustream.h File 1.89 KB 0644
ustring.h File 72.47 KB 0644
ustringtrie.h File 3.15 KB 0644
utext.h File 58.13 KB 0644
utf.h File 7.86 KB 0644
utf16.h File 23.32 KB 0644
utf32.h File 763 B 0644
utf8.h File 30.96 KB 0644
utf_old.h File 45.83 KB 0644
utmscale.h File 13.78 KB 0644
utrace.h File 15.73 KB 0644
utrans.h File 25.52 KB 0644
utypes.h File 30.74 KB 0644
uvernum.h File 6.67 KB 0644
uversion.h File 6 KB 0644
vtzone.h File 20.3 KB 0644