Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 // © 2018 and later: Unicode, Inc. and others. | 1 // © 2018 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html | 2 // License & terms of use: http://www.unicode.org/copyright.html |
3 | 3 |
4 #include "unicode/utypes.h" | 4 #include "unicode/utypes.h" |
5 | 5 |
6 #if !UCONFIG_NO_FORMATTING | 6 #if !UCONFIG_NO_FORMATTING |
7 | 7 |
8 // Allow implicit conversion from char16_t* to UnicodeString for this file: | 8 // Allow implicit conversion from char16_t* to UnicodeString for this file: |
9 // Helpful in toString methods and elsewhere. | 9 // Helpful in toString methods and elsewhere. |
10 #define UNISTR_FROM_STRING_EXPLICIT | 10 #define UNISTR_FROM_STRING_EXPLICIT |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 } | 112 } |
113 } | 113 } |
114 }; | 114 }; |
115 | 115 |
116 | 116 |
117 icu::UInitOnce gNumberParseUniSetsInitOnce = U_INITONCE_INITIALIZER; | 117 icu::UInitOnce gNumberParseUniSetsInitOnce = U_INITONCE_INITIALIZER; |
118 | 118 |
119 UBool U_CALLCONV cleanupNumberParseUniSets() { | 119 UBool U_CALLCONV cleanupNumberParseUniSets() { |
120 if (gEmptyUnicodeSetInitialized) { | 120 if (gEmptyUnicodeSetInitialized) { |
121 reinterpret_cast<UnicodeSet*>(gEmptyUnicodeSet)->~UnicodeSet(); | 121 reinterpret_cast<UnicodeSet*>(gEmptyUnicodeSet)->~UnicodeSet(); |
122 gEmptyUnicodeSetInitialized = false; | 122 gEmptyUnicodeSetInitialized = FALSE; |
markus.icu
2018/05/16 02:36:34
FALSE
sffc
2018/05/16 22:05:44
Done.
| |
123 } | 123 } |
124 for (int32_t i = 0; i < COUNT; i++) { | 124 for (int32_t i = 0; i < COUNT; i++) { |
125 delete gUnicodeSets[i]; | 125 delete gUnicodeSets[i]; |
126 gUnicodeSets[i] = nullptr; | 126 gUnicodeSets[i] = nullptr; |
127 } | 127 } |
128 gNumberParseUniSetsInitOnce.reset(); | 128 gNumberParseUniSetsInitOnce.reset(); |
129 return TRUE; | 129 return TRUE; |
130 } | 130 } |
131 | 131 |
132 void U_CALLCONV initNumberParseUniSets(UErrorCode& status) { | 132 void U_CALLCONV initNumberParseUniSets(UErrorCode& status) { |
133 ucln_common_registerCleanup(UCLN_COMMON_NUMPARSE_UNISETS, cleanupNumberParse UniSets); | 133 ucln_common_registerCleanup(UCLN_COMMON_NUMPARSE_UNISETS, cleanupNumberParse UniSets); |
134 | 134 |
135 // Initialize the empty instance for well-defined fallback behavior | 135 // Initialize the empty instance for well-defined fallback behavior |
136 new(gEmptyUnicodeSet) UnicodeSet(); | 136 new(gEmptyUnicodeSet) UnicodeSet(); |
137 reinterpret_cast<UnicodeSet*>(gEmptyUnicodeSet)->freeze(); | 137 reinterpret_cast<UnicodeSet*>(gEmptyUnicodeSet)->freeze(); |
138 gEmptyUnicodeSetInitialized = true; | 138 gEmptyUnicodeSetInitialized = TRUE; |
markus.icu
2018/05/16 02:36:34
TRUE
sffc
2018/05/16 22:05:44
Done.
| |
139 | 139 |
140 // These sets were decided after discussion with icu-design@. See tickets #1 3084 and #13309. | 140 // These sets were decided after discussion with icu-design@. See tickets #1 3084 and #13309. |
141 // Zs+TAB is "horizontal whitespace" according to UTS #18 (blank property). | 141 // Zs+TAB is "horizontal whitespace" according to UTS #18 (blank property). |
142 gUnicodeSets[DEFAULT_IGNORABLES] = new UnicodeSet( | 142 gUnicodeSets[DEFAULT_IGNORABLES] = new UnicodeSet( |
143 u"[[:Zs:][\\u0009][:Bidi_Control:][:Variation_Selector:]]", status); | 143 u"[[:Zs:][\\u0009][:Bidi_Control:][:Variation_Selector:]]", status); |
144 gUnicodeSets[STRICT_IGNORABLES] = new UnicodeSet(u"[[:Bidi_Control:]]", stat us); | 144 gUnicodeSets[STRICT_IGNORABLES] = new UnicodeSet(u"[[:Bidi_Control:]]", stat us); |
145 | 145 |
146 LocalUResourceBundlePointer rb(ures_open(nullptr, "root", &status)); | 146 LocalUResourceBundlePointer rb(ures_open(nullptr, "root", &status)); |
147 if (U_FAILURE(status)) { return; } | 147 if (U_FAILURE(status)) { return; } |
148 ParseDataSink sink; | 148 ParseDataSink sink; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 // return RUPEE_SIGN; | 213 // return RUPEE_SIGN; |
214 // } else if (get(YEN_SIGN)->contains(str)) { | 214 // } else if (get(YEN_SIGN)->contains(str)) { |
215 // return YEN_SIGN; | 215 // return YEN_SIGN; |
216 // } else { | 216 // } else { |
217 // return NONE; | 217 // return NONE; |
218 // } | 218 // } |
219 //} | 219 //} |
220 | 220 |
221 | 221 |
222 #endif /* #if !UCONFIG_NO_FORMATTING */ | 222 #endif /* #if !UCONFIG_NO_FORMATTING */ |
LEFT | RIGHT |