include
ecl
formatters
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
*****************************************************************************/
29
enum
Alignment
30
{
31
NoAlign
,
32
LeftAlign
,
33
RightAlign
,
34
CentreAlign
,
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_*/
ecl
Embedded control libraries.
ecl::LeftAlign
Align to the left.
Definition:
common.hpp:32
ecl::Format
Primary template for all formatter classes.
Definition:
common.hpp:99
ecl::PrecisionWidth::value
static const int value
Definition:
common.hpp:53
ecl::NoAlign
No alignment used.
Definition:
common.hpp:31
ecl::PrecisionWidth
Precision width trait for fundamental types.
Definition:
common.hpp:51
ecl::RightAlign
Align to the right.
Definition:
common.hpp:33
ecl::Alignment
Alignment
Alignment tags for text formatting.
Definition:
common.hpp:29
ecl::CentreAlign
Align in the centre.
Definition:
common.hpp:34
ecl_formatters
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:36