ICU 62.1 62.1
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
61#endif // U_HIDE_DEPRECATED_API
62};
63typedef enum UCurrencyUsage UCurrencyUsage;
64
80U_STABLE int32_t U_EXPORT2
81ucurr_forLocale(const char* locale,
82 UChar* buff,
83 int32_t buffCapacity,
84 UErrorCode* ec);
85
92typedef enum UCurrNameStyle {
99
106
107#ifndef U_HIDE_DRAFT_API
118#endif // U_HIDE_DRAFT_API
120
121#if !UCONFIG_NO_SERVICE
125typedef const void* UCurrRegistryKey;
126
139ucurr_register(const UChar* isoCode,
140 const char* locale,
141 UErrorCode* status);
153U_STABLE UBool U_EXPORT2
155#endif /* UCONFIG_NO_SERVICE */
156
174U_STABLE const UChar* U_EXPORT2
175ucurr_getName(const UChar* currency,
176 const char* locale,
177 UCurrNameStyle nameStyle,
178 UBool* isChoiceFormat,
179 int32_t* len,
180 UErrorCode* ec);
181
198U_STABLE const UChar* U_EXPORT2
200 const char* locale,
201 UBool* isChoiceFormat,
202 const char* pluralCount,
203 int32_t* len,
204 UErrorCode* ec);
205
216U_STABLE int32_t U_EXPORT2
218 UErrorCode* ec);
219
230U_STABLE int32_t U_EXPORT2
232 const UCurrencyUsage usage,
233 UErrorCode* ec);
234
245U_STABLE double U_EXPORT2
247 UErrorCode* ec);
248
259U_STABLE double U_EXPORT2
261 const UCurrencyUsage usage,
262 UErrorCode* ec);
263
306
316U_STABLE UEnumeration * U_EXPORT2
317ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode);
318
345U_STABLE UBool U_EXPORT2
346ucurr_isAvailable(const UChar* isoCode,
347 UDate from,
348 UDate to,
349 UErrorCode* errorCode);
350
365U_STABLE int32_t U_EXPORT2
366ucurr_countCurrencies(const char* locale,
367 UDate date,
368 UErrorCode* ec);
369
389U_STABLE int32_t U_EXPORT2
390ucurr_forLocaleAndDate(const char* locale,
391 UDate date,
392 int32_t index,
393 UChar* buff,
394 int32_t buffCapacity,
395 UErrorCode* ec);
396
413U_STABLE UEnumeration* U_EXPORT2
415 const char* locale,
416 UBool commonlyUsed,
417 UErrorCode* status);
418
428U_STABLE int32_t U_EXPORT2
430
431#endif /* #if !UCONFIG_NO_FORMATTING */
432
433#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:270
@ UCURR_UNCOMMON
Select ISO-4217 uncommon currency codes.
Definition ucurr.h:292
@ UCURR_NON_DEPRECATED
Select only non-deprecated ISO-4217 codes.
Definition ucurr.h:304
@ UCURR_ALL
Select all ISO-4217 currency codes.
Definition ucurr.h:275
@ UCURR_DEPRECATED
Select only deprecated ISO-4217 codes.
Definition ucurr.h:298
@ UCURR_COMMON
Select only ISO-4217 commonly used currency codes.
Definition ucurr.h:284
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:125
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:92
@ UCURR_SYMBOL_NAME
Selector for ucurr_getName indicating a symbolic name for a currency, such as "$" for USD.
Definition ucurr.h:98
@ UCURR_NARROW_SYMBOL_NAME
Selector for getName() indicating the narrow currency symbol.
Definition ucurr.h:117
@ UCURR_LONG_NAME
Selector for ucurr_getName indicating the long name for a currency, such as "US Dollar" for USD.
Definition ucurr.h:105
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:41
@ UCURR_USAGE_COUNT
One higher than the last enum UCurrencyUsage constant.
Definition ucurr.h:60
@ UCURR_USAGE_STANDARD
a setting to specify currency usage which determines currency digit and rounding for standard usage,...
Definition ucurr.h:48
@ UCURR_USAGE_CASH
a setting to specify currency usage which determines currency digit and rounding for cash usage,...
Definition ucurr.h:54
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:43
#define INT32_MAX
The largest value a 32 bit signed integer can hold.
Definition umachine.h:182
int8_t UBool
The ICU boolean type.
Definition umachine.h:236
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition umachine.h:353
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition umachine.h:111
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:396
double UDate
Date and Time data type.
Definition utypes.h:203