2 *******************************************************************************
3 * Copyright (C) 1997-2015, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 #ifndef _DECIMAL_FORMAT_PATTERN
8 #define _DECIMAL_FORMAT_PATTERN
10 #include "unicode/utypes.h"
12 #if !UCONFIG_NO_FORMATTING
14 #include "unicode/uobject.h"
15 #include "unicode/unistr.h"
17 #include "affixpatternparser.h"
21 // currency sign count
22 enum CurrencySignCount
{
23 fgCurrencySignCountZero
,
24 fgCurrencySignCountInSymbolFormat
,
25 fgCurrencySignCountInISOFormat
,
26 fgCurrencySignCountInPluralFormat
29 class DecimalFormatSymbols
;
31 struct DecimalFormatPattern
: UMemory
{
39 DecimalFormatPattern();
41 int32_t fMinimumIntegerDigits
;
42 int32_t fMaximumIntegerDigits
;
43 int32_t fMinimumFractionDigits
;
44 int32_t fMaximumFractionDigits
;
45 UBool fUseSignificantDigits
;
46 int32_t fMinimumSignificantDigits
;
47 int32_t fMaximumSignificantDigits
;
48 UBool fUseExponentialNotation
;
49 int32_t fMinExponentDigits
;
50 UBool fExponentSignAlwaysShown
;
51 int32_t fCurrencySignCount
;
53 int32_t fGroupingSize
;
54 int32_t fGroupingSize2
;
56 UBool fDecimalSeparatorAlwaysShown
;
58 UBool fRoundingIncrementUsed
;
59 DigitList fRoundingIncrement
;
61 UBool fNegPatternsBogus
;
62 UBool fPosPatternsBogus
;
63 UnicodeString fNegPrefixPattern
;
64 UnicodeString fNegSuffixPattern
;
65 UnicodeString fPosPrefixPattern
;
66 UnicodeString fPosSuffixPattern
;
67 AffixPattern fNegPrefixAffix
;
68 AffixPattern fNegSuffixAffix
;
69 AffixPattern fPosPrefixAffix
;
70 AffixPattern fPosSuffixAffix
;
71 EPadPosition fPadPosition
;
74 class DecimalFormatPatternParser
: UMemory
{
76 DecimalFormatPatternParser();
77 void useSymbols(const DecimalFormatSymbols
& symbols
);
79 void applyPatternWithoutExpandAffix(
80 const UnicodeString
& pattern
,
81 DecimalFormatPattern
& out
,
82 UParseError
& parseError
,
85 DecimalFormatPatternParser(const DecimalFormatPatternParser
&);
86 DecimalFormatPatternParser
& operator=(DecimalFormatPatternParser
& rhs
);
89 UnicodeString fGroupingSeparator
;
90 UnicodeString fDecimalSeparator
;
91 UnicodeString fPercent
;
92 UnicodeString fPerMill
;
94 UnicodeString fSeparator
;
95 UnicodeString fExponent
;
98 UnicodeString fPadEscape
;
103 #endif /* !UCONFIG_NO_FORMATTING */