]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
57a6839d A |
3 | /* |
4 | ******************************************************************************* | |
2ca993e8 | 5 | * Copyright (C) 1997-2015, International Business Machines Corporation and * |
57a6839d A |
6 | * others. All Rights Reserved. * |
7 | ******************************************************************************* | |
8 | */ | |
9 | #ifndef _DECIMAL_FORMAT_PATTERN | |
10 | #define _DECIMAL_FORMAT_PATTERN | |
11 | ||
12 | #include "unicode/utypes.h" | |
13 | ||
14 | #if !UCONFIG_NO_FORMATTING | |
15 | ||
16 | #include "unicode/uobject.h" | |
17 | #include "unicode/unistr.h" | |
18 | #include "digitlst.h" | |
2ca993e8 | 19 | #include "affixpatternparser.h" |
57a6839d A |
20 | |
21 | U_NAMESPACE_BEGIN | |
22 | ||
23 | // currency sign count | |
24 | enum CurrencySignCount { | |
25 | fgCurrencySignCountZero, | |
26 | fgCurrencySignCountInSymbolFormat, | |
27 | fgCurrencySignCountInISOFormat, | |
28 | fgCurrencySignCountInPluralFormat | |
29 | }; | |
30 | ||
31 | class DecimalFormatSymbols; | |
32 | ||
f3c0d7a5 | 33 | struct DecimalFormatPattern : public UMemory { |
57a6839d A |
34 | enum EPadPosition { |
35 | kPadBeforePrefix, | |
36 | kPadAfterPrefix, | |
37 | kPadBeforeSuffix, | |
38 | kPadAfterSuffix | |
39 | }; | |
40 | ||
41 | DecimalFormatPattern(); | |
42 | ||
43 | int32_t fMinimumIntegerDigits; | |
44 | int32_t fMaximumIntegerDigits; | |
45 | int32_t fMinimumFractionDigits; | |
46 | int32_t fMaximumFractionDigits; | |
47 | UBool fUseSignificantDigits; | |
48 | int32_t fMinimumSignificantDigits; | |
49 | int32_t fMaximumSignificantDigits; | |
50 | UBool fUseExponentialNotation; | |
51 | int32_t fMinExponentDigits; | |
52 | UBool fExponentSignAlwaysShown; | |
53 | int32_t fCurrencySignCount; | |
54 | UBool fGroupingUsed; | |
55 | int32_t fGroupingSize; | |
56 | int32_t fGroupingSize2; | |
57 | int32_t fMultiplier; | |
58 | UBool fDecimalSeparatorAlwaysShown; | |
59 | int32_t fFormatWidth; | |
60 | UBool fRoundingIncrementUsed; | |
61 | DigitList fRoundingIncrement; | |
62 | UChar32 fPad; | |
63 | UBool fNegPatternsBogus; | |
64 | UBool fPosPatternsBogus; | |
65 | UnicodeString fNegPrefixPattern; | |
66 | UnicodeString fNegSuffixPattern; | |
67 | UnicodeString fPosPrefixPattern; | |
68 | UnicodeString fPosSuffixPattern; | |
2ca993e8 A |
69 | AffixPattern fNegPrefixAffix; |
70 | AffixPattern fNegSuffixAffix; | |
71 | AffixPattern fPosPrefixAffix; | |
72 | AffixPattern fPosSuffixAffix; | |
57a6839d A |
73 | EPadPosition fPadPosition; |
74 | }; | |
75 | ||
f3c0d7a5 | 76 | class DecimalFormatPatternParser : public UMemory { |
57a6839d A |
77 | public: |
78 | DecimalFormatPatternParser(); | |
79 | void useSymbols(const DecimalFormatSymbols& symbols); | |
80 | ||
81 | void applyPatternWithoutExpandAffix( | |
82 | const UnicodeString& pattern, | |
83 | DecimalFormatPattern& out, | |
84 | UParseError& parseError, | |
85 | UErrorCode& status); | |
86 | private: | |
87 | DecimalFormatPatternParser(const DecimalFormatPatternParser&); | |
88 | DecimalFormatPatternParser& operator=(DecimalFormatPatternParser& rhs); | |
89 | UChar32 fZeroDigit; | |
90 | UChar32 fSigDigit; | |
91 | UnicodeString fGroupingSeparator; | |
92 | UnicodeString fDecimalSeparator; | |
93 | UnicodeString fPercent; | |
94 | UnicodeString fPerMill; | |
95 | UnicodeString fDigit; | |
96 | UnicodeString fSeparator; | |
97 | UnicodeString fExponent; | |
98 | UnicodeString fPlus; | |
99 | UnicodeString fMinus; | |
100 | UnicodeString fPadEscape; | |
101 | }; | |
102 | ||
103 | U_NAMESPACE_END | |
104 | ||
105 | #endif /* !UCONFIG_NO_FORMATTING */ | |
106 | #endif |