CBMC
format_spec.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_UTIL_FORMAT_SPEC_H
11 #define CPROVER_UTIL_FORMAT_SPEC_H
12 
13 // this mimics the 'printf' format string for a single 'directive'
14 
16 {
17 public:
18  unsigned min_width;
19  unsigned precision;
21 
22  // 'printf' equivalents:
23  // fF: DECIMAL
24  // eE: SCIENTIFIC
25  // gG: AUTOMATIC
26 
27  enum class stylet { DECIMAL, SCIENTIFIC, AUTOMATIC };
29 
31  min_width(0),
32  precision(6),
33  zero_padding(false),
34  style(stylet::AUTOMATIC)
35  {
36  }
37 
38  explicit format_spect(stylet _style):
39  min_width(0),
40  precision(6),
41  zero_padding(false),
42  style(_style)
43  {
44  }
45 
47  {
49  }
50 
52  {
54  }
55 };
56 
57 #endif // CPROVER_UTIL_FORMAT_SPEC_H
format_spect(stylet _style)
Definition: format_spec.h:38
stylet style
Definition: format_spec.h:28
bool zero_padding
Definition: format_spec.h:20
unsigned precision
Definition: format_spec.h:19
unsigned min_width
Definition: format_spec.h:18
static format_spect automatic()
Definition: format_spec.h:51
static format_spect scientific()
Definition: format_spec.h:46