]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/numparse_utils.h
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 __NUMPARSE_UTILS_H__
8 #define __NUMPARSE_UTILS_H__
10 #include "numparse_types.h"
11 #include "unicode/uniset.h"
13 U_NAMESPACE_BEGIN
namespace numparse
{
18 inline static void putLeadCodePoints(const UnicodeSet
* input
, UnicodeSet
* output
) {
19 for (int32_t i
= 0; i
< input
->getRangeCount(); i
++) {
20 output
->add(input
->getRangeStart(i
), input
->getRangeEnd(i
));
22 // TODO: ANDY: How to iterate over the strings in ICU4C UnicodeSet?
25 inline static void putLeadCodePoint(const UnicodeString
& input
, UnicodeSet
* output
) {
26 if (!input
.isEmpty()) {
27 output
->add(input
.char32At(0));
31 inline static void copyCurrencyCode(UChar
* dest
, const UChar
* src
) {
32 uprv_memcpy(dest
, src
, sizeof(UChar
) * 3);
39 } // namespace numparse
42 #endif //__NUMPARSE_UTILS_H__
43 #endif /* #if !UCONFIG_NO_FORMATTING */