1 // © 2018 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 #include "unicode/utypes.h"
6 #if !UCONFIG_NO_FORMATTING
7 #ifndef __SOURCE_NUMBER_CURRENCYSYMBOLS_H__
8 #define __SOURCE_NUMBER_CURRENCYSYMBOLS_H__
10 #include "numparse_types.h"
12 #include "number_decimfmtprops.h"
14 U_NAMESPACE_BEGIN
namespace number
{
18 // Exported as U_I18N_API for tests
19 class U_I18N_API CurrencySymbols
: public UMemory
{
21 CurrencySymbols() = default; // default constructor: leaves class in valid but undefined state
23 /** Creates an instance in which all symbols are loaded from data. */
24 CurrencySymbols(CurrencyUnit currency
, const Locale
& locale
, UErrorCode
& status
);
26 /** Creates an instance in which some symbols might be pre-populated. */
27 CurrencySymbols(CurrencyUnit currency
, const Locale
& locale
, const DecimalFormatSymbols
& symbols
,
30 const char16_t* getIsoCode() const;
32 UnicodeString
getNarrowCurrencySymbol(UErrorCode
& status
) const;
34 UnicodeString
getCurrencySymbol(UErrorCode
& status
) const;
36 UnicodeString
getIntlCurrencySymbol(UErrorCode
& status
) const;
38 UnicodeString
getPluralName(StandardPlural::Form plural
, UErrorCode
& status
) const;
42 CurrencyUnit fCurrency
;
43 CharString fLocaleName
;
46 UnicodeString fCurrencySymbol
;
47 UnicodeString fIntlCurrencySymbol
;
49 UnicodeString
loadSymbol(UCurrNameStyle selector
, UErrorCode
& status
) const;
54 * Resolves the effective currency from the property bag.
57 resolveCurrency(const DecimalFormatProperties
& properties
, const Locale
& locale
, UErrorCode
& status
);
61 } // namespace numparse
64 #endif //__SOURCE_NUMBER_CURRENCYSYMBOLS_H__
65 #endif /* #if !UCONFIG_NO_FORMATTING */