common.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_FORMATTERS_COMMON_HPP_
13 #define ECL_FORMATTERS_COMMON_HPP_
14 
15 /*****************************************************************************
16 ** Namespaces
17 *****************************************************************************/
18 
19 namespace ecl {
20 
21 /*****************************************************************************
22 ** Format Tags
23 *****************************************************************************/
30 {
35 };
36 
37 /*****************************************************************************
38 ** Default precision widths
39 *****************************************************************************/
40 /*
41  * These must match the default format precisions for each fundamental type.
42  */
51 template <typename Type> struct PrecisionWidth {
52  public:
53  static const int value = 0;
54 };
55 
64 template <>
65 struct PrecisionWidth<float> {
66  public:
67  static const int value = 4;
68 };
69 
78 template <>
79 struct PrecisionWidth<double> {
80  public:
81  static const int value = 4;
82 };
83 
84 /*****************************************************************************
85 * Format Classes
86 *****************************************************************************/
98 template <typename T>
99 class Format : public T::Formatter {};
100 
101 }; // namespace ecl
102 
103 #endif /*ECL_FORMATTERS_COMMON_HPP_*/
Embedded control libraries.
Align to the left.
Definition: common.hpp:32
Primary template for all formatter classes.
Definition: common.hpp:99
static const int value
Definition: common.hpp:53
No alignment used.
Definition: common.hpp:31
Precision width trait for fundamental types.
Definition: common.hpp:51
Align to the right.
Definition: common.hpp:33
Alignment
Alignment tags for text formatting.
Definition: common.hpp:29
Align in the centre.
Definition: common.hpp:34


ecl_formatters
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:36