ICU 50.2 50.2
ucurr.h
Go to the documentation of this file.
1/*
2**********************************************************************
3* Copyright (c) 2002-2012, 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
17
18#if !UCONFIG_NO_FORMATTING
19
36
52U_STABLE int32_t U_EXPORT2
53ucurr_forLocale(const char* locale,
54 UChar* buff,
55 int32_t buffCapacity,
56 UErrorCode* ec);
57
79
80#if !UCONFIG_NO_SERVICE
84typedef const void* UCurrRegistryKey;
85
98ucurr_register(const UChar* isoCode,
99 const char* locale,
100 UErrorCode* status);
112U_STABLE UBool U_EXPORT2
114#endif /* UCONFIG_NO_SERVICE */
115
133U_STABLE const UChar* U_EXPORT2
134ucurr_getName(const UChar* currency,
135 const char* locale,
136 UCurrNameStyle nameStyle,
137 UBool* isChoiceFormat,
138 int32_t* len,
139 UErrorCode* ec);
140
157U_STABLE const UChar* U_EXPORT2
159 const char* locale,
160 UBool* isChoiceFormat,
161 const char* pluralCount,
162 int32_t* len,
163 UErrorCode* ec);
164
174U_STABLE int32_t U_EXPORT2
176 UErrorCode* ec);
177
187U_STABLE double U_EXPORT2
189 UErrorCode* ec);
190
233
243U_STABLE UEnumeration * U_EXPORT2
244ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode);
245
272U_STABLE UBool U_EXPORT2
273ucurr_isAvailable(const UChar* isoCode,
274 UDate from,
275 UDate to,
276 UErrorCode* errorCode);
277
292U_STABLE int32_t U_EXPORT2
293ucurr_countCurrencies(const char* locale,
294 UDate date,
295 UErrorCode* ec);
296
316U_STABLE int32_t U_EXPORT2
317ucurr_forLocaleAndDate(const char* locale,
318 UDate date,
319 int32_t index,
320 UChar* buff,
321 int32_t buffCapacity,
322 UErrorCode* ec);
323
340U_STABLE UEnumeration* U_EXPORT2
342 const char* locale,
343 UBool commonlyUsed,
344 UErrorCode* status);
345
346#ifndef U_HIDE_DRAFT_API
356U_DRAFT int32_t U_EXPORT2
358#endif /* U_HIDE_DRAFT_API */
359
360#endif /* #if !UCONFIG_NO_FORMATTING */
361
362#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:197
@ UCURR_UNCOMMON
Select ISO-4217 uncommon currency codes.
Definition ucurr.h:219
@ UCURR_NON_DEPRECATED
Select only non-deprecated ISO-4217 codes.
Definition ucurr.h:231
@ UCURR_ALL
Select all ISO-4217 currency codes.
Definition ucurr.h:202
@ UCURR_DEPRECATED
Select only deprecated ISO-4217 codes.
Definition ucurr.h:225
@ UCURR_COMMON
Select only ISO-4217 commonly used currency codes.
Definition ucurr.h:211
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:84
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)
The ucurr API encapsulates information about a currency, as defined by ISO 4217.
UCurrNameStyle
Selector constants for ucurr_getName().
Definition ucurr.h:64
@ UCURR_SYMBOL_NAME
Selector for ucurr_getName indicating a symbolic name for a currency, such as "$" for USD.
Definition ucurr.h:70
@ UCURR_LONG_NAME
Selector for ucurr_getName indicating the long name for a currency, such as "US Dollar" for USD.
Definition ucurr.h:77
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.
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:146
int8_t UBool
The ICU boolean type.
Definition umachine.h:200
#define U_DRAFT
This is used to declare a function as a draft public ICU C API.
Definition umachine.h:111
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:278
#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