ICU 57.1 57.1
ucurr.h
Go to the documentation of this file.
1/*
2**********************************************************************
3* Copyright (c) 2002-2016, International Business Machines
4* Corporation and others. All Rights Reserved.
5**********************************************************************
6*/
7#ifndef _UCURR_H_
8#define _UCURR_H_
9
10#include "unicode/utypes.h"
11#include "unicode/uenum.h"
12
32
33#if !UCONFIG_NO_FORMATTING
34
59typedef enum UCurrencyUsage UCurrencyUsage;
60
76U_STABLE int32_t U_EXPORT2
77ucurr_forLocale(const char* locale,
78 UChar* buff,
79 int32_t buffCapacity,
80 UErrorCode* ec);
81
103
104#if !UCONFIG_NO_SERVICE
108typedef const void* UCurrRegistryKey;
109
122ucurr_register(const UChar* isoCode,
123 const char* locale,
124 UErrorCode* status);
136U_STABLE UBool U_EXPORT2
138#endif /* UCONFIG_NO_SERVICE */
139
157U_STABLE const UChar* U_EXPORT2
158ucurr_getName(const UChar* currency,
159 const char* locale,
160 UCurrNameStyle nameStyle,
161 UBool* isChoiceFormat,
162 int32_t* len,
163 UErrorCode* ec);
164
181U_STABLE const UChar* U_EXPORT2
183 const char* locale,
184 UBool* isChoiceFormat,
185 const char* pluralCount,
186 int32_t* len,
187 UErrorCode* ec);
188
199U_STABLE int32_t U_EXPORT2
201 UErrorCode* ec);
202
213U_STABLE int32_t U_EXPORT2
215 const UCurrencyUsage usage,
216 UErrorCode* ec);
217
228U_STABLE double U_EXPORT2
230 UErrorCode* ec);
231
242U_STABLE double U_EXPORT2
244 const UCurrencyUsage usage,
245 UErrorCode* ec);
246
289
299U_STABLE UEnumeration * U_EXPORT2
300ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode);
301
328U_STABLE UBool U_EXPORT2
329ucurr_isAvailable(const UChar* isoCode,
330 UDate from,
331 UDate to,
332 UErrorCode* errorCode);
333
348U_STABLE int32_t U_EXPORT2
349ucurr_countCurrencies(const char* locale,
350 UDate date,
351 UErrorCode* ec);
352
372U_STABLE int32_t U_EXPORT2
373ucurr_forLocaleAndDate(const char* locale,
374 UDate date,
375 int32_t index,
376 UChar* buff,
377 int32_t buffCapacity,
378 UErrorCode* ec);
379
396U_STABLE UEnumeration* U_EXPORT2
398 const char* locale,
399 UBool commonlyUsed,
400 UErrorCode* status);
401
411U_STABLE int32_t U_EXPORT2
413
414#endif /* #if !UCONFIG_NO_FORMATTING */
415
416#endif
UEnumeration * ucurr_getKeywordValuesForLocale(const char *key, const char *locale, UBool commonlyUsed, UErrorCode *status)
Given a key and a locale, returns an array of string values in a preferred order that would make a di...
double 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.
int32_t ucurr_forLocaleAndDate(const char *locale, UDate date, int32_t index, UChar *buff, int32_t buffCapacity, UErrorCode *ec)
Finds a currency code for the given locale and date.
UCurrCurrencyType
Selector constants for ucurr_openCurrencies().
Definition ucurr.h:253
@ UCURR_UNCOMMON
Select ISO-4217 uncommon currency codes.
Definition ucurr.h:275
@ UCURR_NON_DEPRECATED
Select only non-deprecated ISO-4217 codes.
Definition ucurr.h:287
@ UCURR_ALL
Select all ISO-4217 currency codes.
Definition ucurr.h:258
@ UCURR_DEPRECATED
Select only deprecated ISO-4217 codes.
Definition ucurr.h:281
@ UCURR_COMMON
Select only ISO-4217 commonly used currency codes.
Definition ucurr.h:267
int32_t ucurr_getDefaultFractionDigits(const UChar *currency, UErrorCode *ec)
Returns the number of the number of fraction digits that should be displayed for the given currency.
const void * UCurrRegistryKey
Definition ucurr.h:108
UEnumeration * ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode)
Provides a UEnumeration object for listing ISO-4217 codes.
const UChar * ucurr_getPluralName(const UChar *currency, const char *locale, UBool *isChoiceFormat, const char *pluralCount, int32_t *len, UErrorCode *ec)
Returns the plural name for the given currency in the given locale.
int32_t ucurr_getNumericCode(const UChar *currency)
Returns the ISO 4217 numeric code for the currency.
UBool ucurr_isAvailable(const UChar *isoCode, UDate from, UDate to, UErrorCode *errorCode)
Queries if the given ISO 4217 3-letter code is available on the specified date range.
int32_t ucurr_countCurrencies(const char *locale, UDate date, UErrorCode *ec)
Finds the number of valid currency codes for the given locale and date.
int32_t ucurr_forLocale(const char *locale, UChar *buff, int32_t buffCapacity, UErrorCode *ec)
Finds a currency code for the given locale.
UCurrNameStyle
Selector constants for ucurr_getName().
Definition ucurr.h:88
@ UCURR_SYMBOL_NAME
Selector for ucurr_getName indicating a symbolic name for a currency, such as "$" for USD.
Definition ucurr.h:94
@ UCURR_LONG_NAME
Selector for ucurr_getName indicating the long name for a currency, such as "US Dollar" for USD.
Definition ucurr.h:101
int32_t ucurr_getDefaultFractionDigitsForUsage(const UChar *currency, const UCurrencyUsage usage, UErrorCode *ec)
Returns the number of the number of fraction digits that should be displayed for the given currency w...
UBool ucurr_unregister(UCurrRegistryKey key, UErrorCode *status)
Unregister the previously-registered currency definitions using the URegistryKey returned from ucurr_...
UCurrRegistryKey ucurr_register(const UChar *isoCode, const char *locale, UErrorCode *status)
Register an (existing) ISO 4217 currency code for the given locale.
UCurrencyUsage
Currency Usage used for Decimal Format.
Definition ucurr.h:39
@ UCURR_USAGE_COUNT
One higher than the last enum UCurrencyUsage constant.
Definition ucurr.h:57
@ UCURR_USAGE_STANDARD
a setting to specify currency usage which determines currency digit and rounding for standard usage,...
Definition ucurr.h:46
@ UCURR_USAGE_CASH
a setting to specify currency usage which determines currency digit and rounding for cash usage,...
Definition ucurr.h:52
double ucurr_getRoundingIncrementForUsage(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 ...
const UChar * ucurr_getName(const UChar *currency, const char *locale, UCurrNameStyle nameStyle, UBool *isChoiceFormat, int32_t *len, UErrorCode *ec)
Returns the display name for the given currency in the given locale.
C API: String Enumeration.
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition uenum.h:39
#define INT32_MAX
The largest value a 32 bit signed integer can hold.
Definition umachine.h:180
int8_t UBool
The ICU boolean type.
Definition umachine.h:234
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition umachine.h:312
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition umachine.h:109
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:476
double UDate
Date and Time data type.
Definition utypes.h:201