ICU 64.2  64.2
ucurr.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 **********************************************************************
5 * Copyright (c) 2002-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
8 */
9 #ifndef _UCURR_H_
10 #define _UCURR_H_
11 
12 #include "unicode/utypes.h"
13 #include "unicode/uenum.h"
14 
35 #if !UCONFIG_NO_FORMATTING
36 
55 #ifndef U_HIDE_DEPRECATED_API
56 
61 #endif // U_HIDE_DEPRECATED_API
62 };
65 
81 U_STABLE int32_t U_EXPORT2
82 ucurr_forLocale(const char* locale,
83  UChar* buff,
84  int32_t buffCapacity,
85  UErrorCode* ec);
86 
93 typedef enum UCurrNameStyle {
100 
107 
118 
119 #if !UCONFIG_NO_SERVICE
120 
123 typedef const void* UCurrRegistryKey;
124 
136 U_STABLE UCurrRegistryKey U_EXPORT2
137 ucurr_register(const UChar* isoCode,
138  const char* locale,
139  UErrorCode* status);
151 U_STABLE UBool U_EXPORT2
153 #endif /* UCONFIG_NO_SERVICE */
154 
172 U_STABLE const UChar* U_EXPORT2
173 ucurr_getName(const UChar* currency,
174  const char* locale,
175  UCurrNameStyle nameStyle,
176  UBool* isChoiceFormat,
177  int32_t* len,
178  UErrorCode* ec);
179 
196 U_STABLE const UChar* U_EXPORT2
197 ucurr_getPluralName(const UChar* currency,
198  const char* locale,
199  UBool* isChoiceFormat,
200  const char* pluralCount,
201  int32_t* len,
202  UErrorCode* ec);
203 
221 U_STABLE int32_t U_EXPORT2
222 ucurr_getDefaultFractionDigits(const UChar* currency,
223  UErrorCode* ec);
224 
242 U_STABLE int32_t U_EXPORT2
244  const UCurrencyUsage usage,
245  UErrorCode* ec);
246 
257 U_STABLE double U_EXPORT2
258 ucurr_getRoundingIncrement(const UChar* currency,
259  UErrorCode* ec);
260 
271 U_STABLE double U_EXPORT2
273  const UCurrencyUsage usage,
274  UErrorCode* ec);
275 
282 typedef enum UCurrCurrencyType {
318 
328 U_STABLE UEnumeration * U_EXPORT2
329 ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode);
330 
357 U_STABLE UBool U_EXPORT2
358 ucurr_isAvailable(const UChar* isoCode,
359  UDate from,
360  UDate to,
361  UErrorCode* errorCode);
362 
377 U_STABLE int32_t U_EXPORT2
378 ucurr_countCurrencies(const char* locale,
379  UDate date,
380  UErrorCode* ec);
381 
401 U_STABLE int32_t U_EXPORT2
402 ucurr_forLocaleAndDate(const char* locale,
403  UDate date,
404  int32_t index,
405  UChar* buff,
406  int32_t buffCapacity,
407  UErrorCode* ec);
408 
425 U_STABLE UEnumeration* U_EXPORT2
426 ucurr_getKeywordValuesForLocale(const char* key,
427  const char* locale,
428  UBool commonlyUsed,
429  UErrorCode* status);
430 
440 U_STABLE int32_t U_EXPORT2
441 ucurr_getNumericCode(const UChar* currency);
442 
443 #endif /* #if !UCONFIG_NO_FORMATTING */
444 
445 #endif
UCurrRegistryKey ucurr_register(const UChar *isoCode, const char *locale, UErrorCode *status)
Register an (existing) ISO 4217 currency code for the given locale.
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 ...
Select all ISO-4217 currency codes.
Definition: ucurr.h:287
UCurrCurrencyType
Selector constants for ucurr_openCurrencies().
Definition: ucurr.h:282
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.
double UDate
Date and Time data type.
Definition: utypes.h:203
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:43
UBool ucurr_unregister(UCurrRegistryKey key, UErrorCode *status)
Unregister the previously-registered currency definitions using the URegistryKey returned from ucurr_...
int32_t ucurr_getNumericCode(const UChar *currency)
Returns the ISO 4217 numeric code for the currency.
Selector for getName() indicating the narrow currency symbol.
Definition: ucurr.h:116
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_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...
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.
Select only ISO-4217 commonly used currency codes.
Definition: ucurr.h:296
UCurrencyUsage
Currency Usage used for Decimal Format.
Definition: ucurr.h:41
Selector for ucurr_getName indicating a symbolic name for a currency, such as "$" for USD...
Definition: ucurr.h:99
a setting to specify currency usage which determines currency digit and rounding for cash usage...
Definition: ucurr.h:54
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.
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:342
One higher than the last enum UCurrencyUsage constant.
Definition: ucurr.h:60
#define INT32_MAX
The largest value a 32 bit signed integer can hold.
Definition: umachine.h:171
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
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...
Select only non-deprecated ISO-4217 codes.
Definition: ucurr.h:316
Select ISO-4217 uncommon currency codes.
Definition: ucurr.h:304
UEnumeration * ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode)
Provides a UEnumeration object for listing ISO-4217 codes.
C API: String Enumeration.
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.
Basic definitions for ICU, for both C and C++ APIs.
const void * UCurrRegistryKey
Definition: ucurr.h:123
UCurrNameStyle
Selector constants for ucurr_getName().
Definition: ucurr.h:93
Select only deprecated ISO-4217 codes.
Definition: ucurr.h:310
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_getDefaultFractionDigits(const UChar *currency, UErrorCode *ec)
Returns the number of the number of fraction digits that should be displayed for the given currency...
a setting to specify currency usage which determines currency digit and rounding for standard usage...
Definition: ucurr.h:48
Selector for ucurr_getName indicating the long name for a currency, such as "US Dollar" for USD...
Definition: ucurr.h:106
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
int8_t UBool
The ICU boolean type.
Definition: umachine.h:225