• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ********************************************************************************
5 *   Copyright (C) 2012-2014, International Business Machines
6 *   Corporation and others.  All Rights Reserved.
7 ********************************************************************************/
8 
9 #ifndef DCFMTIMP_H
10 #define DCFMTIMP_H
11 
12 #include "unicode/utypes.h"
13 
14 
15 #if UCONFIG_FORMAT_FASTPATHS_49
16 
17 U_NAMESPACE_BEGIN
18 
19 enum EDecimalFormatFastpathStatus {
20   kFastpathNO = 0,
21   kFastpathYES = 1,
22   kFastpathUNKNOWN = 2, /* not yet set */
23   kFastpathMAYBE = 3 /* depends on value being formatted. */
24 };
25 
26 /**
27  * Must be smaller than DecimalFormat::fReserved
28  */
29 struct DecimalFormatInternal {
30   uint8_t    fFastFormatStatus;
31   uint8_t    fFastParseStatus;
32 
33   DecimalFormatInternal &operator=(const DecimalFormatInternal& rhs) {
34     fFastParseStatus = rhs.fFastParseStatus;
35     fFastFormatStatus = rhs.fFastFormatStatus;
36     return *this;
37   }
38 #ifdef FMT_DEBUG
dumpDecimalFormatInternal39   void dump() const {
40     printf("DecimalFormatInternal: fFastFormatStatus=%c, fFastParseStatus=%c\n",
41            "NY?"[(int)fFastFormatStatus&3],
42            "NY?"[(int)fFastParseStatus&3]
43            );
44   }
45 #endif
46 };
47 
48 
49 
50 U_NAMESPACE_END
51 
52 #endif
53 
54 #endif
55