1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 1997-2015, International Business Machines Corporation and *
6 * others. All Rights Reserved. *
7 *******************************************************************************
9 #ifndef _DECIMAL_FORMAT_PATTERN
10 #define _DECIMAL_FORMAT_PATTERN
12 #include "unicode/utypes.h"
14 #if !UCONFIG_NO_FORMATTING
16 #include "unicode/uobject.h"
17 #include "unicode/unistr.h"
19 #include "affixpatternparser.h"
23 // currency sign count
24 enum CurrencySignCount
{
25 fgCurrencySignCountZero
,
26 fgCurrencySignCountInSymbolFormat
,
27 fgCurrencySignCountInISOFormat
,
28 fgCurrencySignCountInPluralFormat
31 class DecimalFormatSymbols
;
33 struct DecimalFormatPattern
: public UMemory
{
41 DecimalFormatPattern();
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
;
55 int32_t fGroupingSize
;
56 int32_t fGroupingSize2
;
58 UBool fDecimalSeparatorAlwaysShown
;
60 UBool fRoundingIncrementUsed
;
61 DigitList fRoundingIncrement
;
63 UBool fNegPatternsBogus
;
64 UBool fPosPatternsBogus
;
65 UnicodeString fNegPrefixPattern
;
66 UnicodeString fNegSuffixPattern
;
67 UnicodeString fPosPrefixPattern
;
68 UnicodeString fPosSuffixPattern
;
69 AffixPattern fNegPrefixAffix
;
70 AffixPattern fNegSuffixAffix
;
71 AffixPattern fPosPrefixAffix
;
72 AffixPattern fPosSuffixAffix
;
73 EPadPosition fPadPosition
;
76 class DecimalFormatPatternParser
: public UMemory
{
78 DecimalFormatPatternParser();
79 void useSymbols(const DecimalFormatSymbols
& symbols
);
81 void applyPatternWithoutExpandAffix(
82 const UnicodeString
& pattern
,
83 DecimalFormatPattern
& out
,
84 UParseError
& parseError
,
87 DecimalFormatPatternParser(const DecimalFormatPatternParser
&);
88 DecimalFormatPatternParser
& operator=(DecimalFormatPatternParser
& rhs
);
91 UnicodeString fGroupingSeparator
;
92 UnicodeString fDecimalSeparator
;
93 UnicodeString fPercent
;
94 UnicodeString fPerMill
;
96 UnicodeString fSeparator
;
97 UnicodeString fExponent
;
100 UnicodeString fPadEscape
;
105 #endif /* !UCONFIG_NO_FORMATTING */