| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
#include "unicode/utypes.h" |
| 5 |
|
| 6 |
#if !UCONFIG_NO_FORMATTING |
| 7 |
#ifndef __NUMPARSE_CURRENCY_H__ |
| 8 |
#define __NUMPARSE_CURRENCY_H__ |
| 9 |
|
| 10 |
#include "numparse_types.h" |
| 11 |
#include "numparse_compositions.h" |
| 12 |
#include "charstr.h" |
| 13 |
#include "number_currencysymbols.h" |
| 14 |
#include "unicode/uniset.h" |
| 15 |
|
| 16 |
U_NAMESPACE_BEGIN |
| 17 |
namespace numparse::impl { |
| 18 |
|
| 19 |
using ::icu::number::impl::CurrencySymbols; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
class U_I18N_API CombinedCurrencyMatcher : public NumberParseMatcher, public UMemory { |
| 34 |
public: |
| 35 |
CombinedCurrencyMatcher() = default; |
| 36 |
|
| 37 |
CombinedCurrencyMatcher(const CurrencySymbols& currencySymbols, const DecimalFormatSymbols& dfs, |
| 38 |
parse_flags_t parseFlags, UErrorCode& status); |
| 39 |
|
| 40 |
bool match(StringSegment& segment, ParsedNumber& result, UErrorCode& status) const override; |
| 41 |
|
| 42 |
bool smokeTest(const StringSegment& segment) const override; |
| 43 |
|
| 44 |
UnicodeString toString() const override; |
| 45 |
|
| 46 |
private: |
| 47 |
char16_t fCurrencyCode[4]; |
| 48 |
UnicodeString fCurrency1; |
| 49 |
UnicodeString fCurrency2; |
| 50 |
|
| 51 |
bool fUseFullCurrencyData; |
| 52 |
UnicodeString fLocalLongNames[StandardPlural::COUNT]; |
| 53 |
|
| 54 |
UnicodeString afterPrefixInsert; |
| 55 |
UnicodeString beforeSuffixInsert; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
CharString fLocaleName; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
bool matchCurrency(StringSegment& segment, ParsedNumber& result, UErrorCode& status) const; |
| 66 |
}; |
| 67 |
|
| 68 |
} |
| 69 |
U_NAMESPACE_END |
| 70 |
|
| 71 |
#endif |
| 72 |
#endif |