1 // © 2018 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 // This file is in common instead of i18n because it is needed by ucurr.cpp.
6 #include "unicode/utypes.h"
8 #if !UCONFIG_NO_FORMATTING
9 #ifndef __STATIC_UNICODE_SETS_H__
10 #define __STATIC_UNICODE_SETS_H__
12 #include "unicode/uniset.h"
13 #include "unicode/unistr.h"
19 // NONE is used to indicate null in chooseFrom().
20 // EMPTY is used to get an empty UnicodeSet.
30 // - COMMA is a superset of STRICT_COMMA
31 // - PERIOD is a superset of SCRICT_PERIOD
32 // - ALL_SEPARATORS is the union of COMMA, PERIOD, and OTHER_GROUPING_SEPARATORS
33 // - STRICT_ALL_SEPARATORS is the union of STRICT_COMMA, STRICT_PERIOD, and OTHER_GRP_SEPARATORS
38 OTHER_GROUPING_SEPARATORS
,
40 STRICT_ALL_SEPARATORS
,
47 INFINITY_KEY
, // INFINITY is defined in cmath
53 YEN_SIGN
, // not in CLDR data, but Currency.java wants it
58 // Combined Separators with Digits (for lead code points)
59 DIGITS_OR_ALL_SEPARATORS
,
60 DIGITS_OR_STRICT_ALL_SEPARATORS
,
62 // The number of elements in the enum.
67 * Gets the static-allocated UnicodeSet according to the provided key. The
68 * pointer will be deleted during u_cleanup(); the caller should NOT delete it.
70 * Exported as U_COMMON_API for ucurr.cpp
72 * @param key The desired UnicodeSet according to the enum in this file.
73 * @return The requested UnicodeSet. Guaranteed to be frozen and non-null, but
74 * may be empty if an error occurred during data loading.
76 U_COMMON_API
const UnicodeSet
* get(Key key
);
79 * Checks if the UnicodeSet given by key1 contains the given string.
81 * Exported as U_COMMON_API for numparse_decimal.cpp
83 * @param str The string to check.
84 * @param key1 The set to check.
85 * @return key1 if the set contains str, or NONE if not.
87 U_COMMON_API Key
chooseFrom(UnicodeString str
, Key key1
);
90 * Checks if the UnicodeSet given by either key1 or key2 contains the string.
92 * Exported as U_COMMON_API for numparse_decimal.cpp
94 * @param str The string to check.
95 * @param key1 The first set to check.
96 * @param key2 The second set to check.
97 * @return key1 if that set contains str; key2 if that set contains str; or
98 * NONE if neither set contains str.
100 U_COMMON_API Key
chooseFrom(UnicodeString str
, Key key1
, Key key2
);
103 // Key chooseCurrency(UnicodeString str);
105 static const struct {
108 } kCurrencyEntries
[] = {
115 } // namespace unisets
118 #endif //__STATIC_UNICODE_SETS_H__
119 #endif /* #if !UCONFIG_NO_FORMATTING */