]>
Commit | Line | Data |
---|---|---|
0f5d89e8 A |
1 | // © 2017 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
3 | ||
4 | #include "unicode/utypes.h" | |
5 | ||
6 | #if !UCONFIG_NO_FORMATTING | |
7 | #ifndef __NUMBER_LONGNAMES_H__ | |
8 | #define __NUMBER_LONGNAMES_H__ | |
9 | ||
10 | #include "unicode/uversion.h" | |
11 | #include "number_utils.h" | |
12 | #include "number_modifiers.h" | |
13 | ||
14 | U_NAMESPACE_BEGIN namespace number { | |
15 | namespace impl { | |
16 | ||
17 | class LongNameHandler : public MicroPropsGenerator, public UMemory { | |
18 | public: | |
19 | static LongNameHandler | |
20 | forCurrencyLongNames(const Locale &loc, const CurrencyUnit ¤cy, const PluralRules *rules, | |
21 | const MicroPropsGenerator *parent, UErrorCode &status); | |
22 | ||
23 | static LongNameHandler | |
24 | forMeasureUnit(const Locale &loc, const MeasureUnit &unit, const MeasureUnit &perUnit, | |
25 | const UNumberUnitWidth &width, const PluralRules *rules, | |
26 | const MicroPropsGenerator *parent, UErrorCode &status); | |
27 | ||
28 | void | |
29 | processQuantity(DecimalQuantity &quantity, MicroProps µs, UErrorCode &status) const U_OVERRIDE; | |
30 | ||
31 | private: | |
32 | SimpleModifier fModifiers[StandardPlural::Form::COUNT]; | |
33 | const PluralRules *rules; | |
34 | const MicroPropsGenerator *parent; | |
35 | ||
36 | LongNameHandler(const PluralRules *rules, const MicroPropsGenerator *parent) | |
37 | : rules(rules), parent(parent) {} | |
38 | ||
39 | static LongNameHandler | |
40 | forCompoundUnit(const Locale &loc, const MeasureUnit &unit, const MeasureUnit &perUnit, | |
41 | const UNumberUnitWidth &width, const PluralRules *rules, | |
42 | const MicroPropsGenerator *parent, UErrorCode &status); | |
43 | ||
44 | static void simpleFormatsToModifiers(const UnicodeString *simpleFormats, Field field, | |
45 | SimpleModifier *output, UErrorCode &status); | |
46 | static void multiSimpleFormatsToModifiers(const UnicodeString *leadFormats, UnicodeString trailFormat, | |
47 | Field field, SimpleModifier *output, UErrorCode &status); | |
48 | }; | |
49 | ||
50 | } // namespace impl | |
51 | } // namespace number | |
52 | U_NAMESPACE_END | |
53 | ||
54 | #endif //__NUMBER_LONGNAMES_H__ | |
55 | ||
56 | #endif /* #if !UCONFIG_NO_FORMATTING */ |