Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Output.h
1 /*
2  * $Id$
3  * Output class implementation
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2004-12, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef ELM_IO_OUTPUT_H
23 #define ELM_IO_OUTPUT_H
24 
25 #include <functional>
26 
27 #include <elm/arch.h>
28 #include <elm/enum_info.h>
29 #include <elm/meta.h>
30 #include <elm/string/CString.h>
31 #include <elm/string/String.h>
32 #include <elm/sys/SystemIO.h>
33 #include <elm/types.h>
34 #include <elm/util/VarArg.h>
35 
36 namespace elm { namespace io {
37 
38 class EOL { };
39 
40 // alignment_t enum
41 typedef enum alignment_t {
42  NONE = 0,
46 } alignment_t;
47 
48 // IntFormat class
49 class IntFormat {
50  inline void init(bool s, int size) {
51  _base = 10;
52  _width = 0;
53  _align = LEFT;
54  _pad = ' ';
55  _upper = false;
56  _sign = s;
57  _displaySign = false;
58  _size = size;
59  }
60 public:
61  inline IntFormat(): _val(0) { init(true, 8); }
62 
63  inline IntFormat(t::int8 value) : _val(value) { init(true, 1); }
64  inline IntFormat(t::uint8 value) : _val(t::uint64(value)) { init(false, 1); }
65  inline IntFormat(t::int16 value) : _val(value) { init(true, 2); }
66  inline IntFormat(t::uint16 value) : _val(t::uint64(value)) { init(false, 2); }
67  inline IntFormat(t::int32 value) : _val(t::int32(value)) { init(true, 4); }
68  inline IntFormat(t::uint32 value) : _val(t::uint32(value)) { init(false, 4); }
69  inline IntFormat(t::int64 value) : _val(value) { init(true, 8); }
70  inline IntFormat(t::uint64 value) : _val(value) { init(false, 8); }
71 
72  inline IntFormat operator()(t::int8 value) { IntFormat f = *this; f._val = value; return f; }
73  inline IntFormat operator()(t::uint8 value) { IntFormat f = *this; f._val = value; return f; }
74  inline IntFormat operator()(t::int16 value) { IntFormat f = *this; f._val = value; return f; }
75  inline IntFormat operator()(t::uint16 value) { IntFormat f = *this; f._val = value; return f; }
76  inline IntFormat operator()(t::int32 value) { IntFormat f = *this; f._val = value; return f; }
77  inline IntFormat operator()(t::uint32 value) { IntFormat f = *this; f._val = value; return f; }
78  inline IntFormat operator()(t::int64 value) { IntFormat f = *this; f._val = value; return f; }
79  inline IntFormat operator()(t::uint64 value) { IntFormat f = *this; f._val = value; return f; }
80 
81  inline IntFormat& base(int b) { _base = b; return *this; }
82  inline IntFormat& bin(void) { _base = 2; _sign = false; return *this; }
83  inline IntFormat& oct(void) { _base = 8; _sign = false; return *this; }
84  inline IntFormat& dec(void) { _base = 10; return *this; }
85  inline IntFormat& hex(void) { _base = 16; _sign = false; return *this; }
86  inline IntFormat& width(int w) { _width = w; return *this; }
87  inline IntFormat& align(alignment_t a) { _align = a; return *this; }
88  inline IntFormat& left(void) { _align = LEFT; return *this; }
89  inline IntFormat& center(void) { _align = CENTER; return *this; }
90  inline IntFormat& right(void) { _align = RIGHT; return *this; }
91  inline IntFormat& upper(void) { _upper = true; return *this; }
92  inline IntFormat& lower(void) { _upper = false; return *this; }
93  inline IntFormat& sign(void) { _displaySign = true; return *this; }
94  inline IntFormat& pad(char p) { _pad = p; return *this; }
95 
97  unsigned char _base;
98  unsigned char _width;
99  unsigned _align : 5;
100  unsigned _upper : 1;
101  unsigned _sign : 1;
102  unsigned _displaySign : 1;
103  char _pad;
104  char _size;
105 };
106 
107 
108 // FloatFormat class
109 class FloatFormat {
110 public:
111  typedef enum {
112  SHORTEST = 0,
113  DECIMAL = 1,
115  } style_t;
116 
117  inline FloatFormat(void): _val(0) { init(); }
118  inline FloatFormat(float val): _val(val) { init(); }
119  inline FloatFormat(double val): _val(val) { init(); }
120 
121  inline FloatFormat operator()(float val) { FloatFormat f = *this; f._val = val; return f; }
122  inline FloatFormat operator()(double val) { FloatFormat f = *this; f._val = val; return f; }
123 
124  inline FloatFormat& width(int w) { _width = w; return *this; }
125  inline FloatFormat& width(int w, int d) { _width = w; _decw = d; return *this; }
126  inline FloatFormat& style(style_t s) { _style = s; return *this; }
127  inline FloatFormat& shortest(void) { _style = SHORTEST; return *this; }
128  inline FloatFormat& decimal(void) { _style = DECIMAL; return *this; }
129  inline FloatFormat& scientific(void) { _style = SCIENTIFIC; return *this; }
130  inline FloatFormat& align(alignment_t a) { _align = a; return *this; }
131  inline FloatFormat& left(void) { _align = LEFT; return *this; }
132  inline FloatFormat& center(void) { _align = CENTER; return *this; }
133  inline FloatFormat& right(void) { _align = RIGHT; return *this; }
134  inline FloatFormat& upper(void) { _upper = true; return *this; }
135  inline FloatFormat& lower(void) { _upper = false; return *this; }
136  inline FloatFormat& pad(char p) { _pad = p; return *this; }
137 
138  double _val;
139  unsigned char _width;
140  unsigned char _decw;
141  unsigned char _style;
142  unsigned char _align: 2;
143  unsigned char _upper: 1;
144  unsigned char _pad;
145 
146 private:
147  void init(void);
148 };
149 
150 
151 // StringFormat class
153 public:
154  StringFormat(void) { init(); }
155  StringFormat(string str): s(str) { init(); }
156 
157  inline StringFormat& operator()(string str) { s = str; return *this; }
158  inline StringFormat& width(int w) { _width = w; return *this; }
159  inline StringFormat& align(alignment_t a) { _align = a; return *this; }
160  inline StringFormat& left(void) { _align = LEFT; return *this; }
161  inline StringFormat& center(void) { _align = CENTER; return *this; }
162  inline StringFormat& right(void) { _align = RIGHT; return *this; }
163  inline StringFormat& pad(char p) { _pad = p; return *this; }
164 
165  string s;
166  unsigned char _width;
167  unsigned char _align: 2;
168  unsigned char _pad;
169 
170 private:
171  void init(void) {
172  _width = 0;
173  _align = LEFT;
174  _pad = ' ';
175  }
176 };
177 
178 // Output class
179 class Output {
180 public:
181  Output(void);
183  inline OutStream& stream(void) const { return *strm; };
184  void setStream(OutStream& stream);
185  void flush(void);
186 
187  void print(bool value);
188  void print(char chr);
189  void print(double value);
190  void print(void *value);
191  inline void print(const char *str) { print(CString(str)); };
192  void print(const CString str);
193  void print(const String& str);
194  void print(const IntFormat& fmt);
195  void print(const FloatFormat& fmt);
196  void print(const StringFormat& fmt);
197  void format(CString fmt, ...);
198  void format(CString fmt, VarArg& args);
199  bool supportsANSI();
200 
201  // deprecated
202  void print(t::int32 value);
203  void print(t::uint32 value);
204  void print(t::int64 value);
205  void print(t::uint64 value);
206 private:
207  OutStream *strm;
208  char ansi;
209  char *horner(char *p, t::uint64 val, int base, char enc = 'a');
210 };
211 
212 
213 // operators accesses
214 template <class T> struct def_printer { static inline void print(Output& out, const T& v) { out.print("<not printable>"); } };
215 template <class T> struct enum_printer { static inline void print(Output& out, const T& v) { out.print(enum_info<T>::toString(v)); } };
216 template <class T> inline Output& operator<<(Output& out, const T& v)
218 template <class T> inline Output& operator<<(Output& out, T *v)
219  { out.print((void *)v); return out; }
220 inline Output& operator<<(Output& out, bool value) { out.print(value); return out; };
221 inline Output& operator<<(Output& out, char value) { out.print(value); return out; };
222 inline Output& operator<<(Output& out, t::int8 value) { out.print(IntFormat(value)); return out; };
223 inline Output& operator<<(Output& out, t::uint8 value) { out.print(IntFormat(value)); return out; };
224 inline Output& operator<<(Output& out, t::int16 value) { out.print(IntFormat(value)); return out; };
225 inline Output& operator<<(Output& out, t::uint16 value) { out.print(IntFormat(value)); return out; };
226 inline Output& operator<<(Output& out, t::int32 value) { out.print(IntFormat(value)); return out; };
227 inline Output& operator<<(Output& out, t::uint32 value) { out.print(IntFormat(value)); return out; };
228 inline Output& operator<<(Output& out, t::int64 value) { out.print(IntFormat(value)); return out; };
229 inline Output& operator<<(Output& out, t::uint64 value) { out.print(IntFormat(value)); return out; };
230 inline Output& operator<<(Output& out, float value) { out.print(value); return out; };
231 inline Output& operator<<(Output& out, double value) { out.print(value); return out; };
232 inline Output& operator<<(Output& out, const char *value) { out.print(value); return out; };
233 inline Output& operator<<(Output& out, char *value) { out.print(value); return out; };
234 inline Output& operator<<(Output& out, const CString value) { out.print(value); return out; };
235 inline Output& operator<<(Output& out, const string& value) { out.print(value); return out; };
236 inline Output& operator<<(Output& out, const IntFormat& value) { out.print(value); return out; };
237 inline Output& operator<<(Output& out, const FloatFormat& value) { out.print(value); return out; }
238 inline Output& operator<<(Output& out, const StringFormat& value) { out.print(value); return out; }
239 inline Output& operator<<(Output& out, EOL eol) { out << '\n'; out.stream().flush(); return out; }
240 
241 // Tag tool
242 template <class P>
243 class Tag {
244 public:
245  typedef cstring t;
246  inline Tag(const typename P::t& val): v(val) { }
247  inline void print(io::Output& out) const { P::print(out, v); }
248 private:
249  const typename P::t v;
250 };
251 template <class P>
252 io::Output& operator<<(io::Output& out, const Tag<P>& t) { t.print(out); return out; }
253 
254 
255 // set style macros (deprecated)
256 inline IntFormat base(int base, IntFormat fmt) { return fmt.base(base); }
257 inline IntFormat bin(IntFormat fmt) { return fmt.bin(); }
258 inline IntFormat oct(IntFormat fmt) { return fmt.oct(); }
259 inline IntFormat hex(IntFormat fmt) { return fmt.hex(); }
260 inline IntFormat sign(IntFormat fmt) { return fmt.sign(); }
261 inline IntFormat width(int width, IntFormat fmt) { return fmt.width(width); }
263 inline IntFormat left(IntFormat fmt) { return fmt.left(); }
264 inline IntFormat right(IntFormat fmt) { return fmt.right(); }
265 inline IntFormat center(IntFormat fmt) { return fmt.center(); }
266 inline IntFormat pad(char pad, IntFormat fmt) { return fmt.pad(pad); }
267 inline IntFormat uppercase(IntFormat fmt) { return fmt.upper(); }
268 inline IntFormat lowercase(IntFormat fmt) { return fmt.lower(); }
269 
270 // fmt macro
271 inline IntFormat fmt(t::int8 i) { return IntFormat(i); }
272 inline IntFormat fmt(t::uint8 i) { return IntFormat(i); }
273 inline IntFormat fmt(t::int16 i) { return IntFormat(i); }
274 inline IntFormat fmt(t::uint16 i) { return IntFormat(i); }
275 inline IntFormat fmt(t::int32 i) { return IntFormat(i); }
276 inline IntFormat fmt(t::uint32 i) { return IntFormat(i); }
277 inline IntFormat fmt(t::int64 i) { return IntFormat(i); }
278 inline IntFormat fmt(t::uint64 i) { return IntFormat(i); }
279 inline FloatFormat fmt(float f) { return FloatFormat(f); }
280 inline FloatFormat fmt(double f) { return FloatFormat(f); }
281 inline StringFormat fmt(string s) { return StringFormat(s); }
282 inline StringFormat fmt(cstring s) { return StringFormat(s); }
283 inline StringFormat fmt(const char *s) { return StringFormat(s); }
284 
285 // output with manager
286 template <class T, class M>
287 class Printable {
288 public:
289  inline Printable(const T& data, const M& man): _data(data), _man(man) { }
290  inline const T& data(void) const { return _data; }
291  inline const M& man(void) const { return _man; }
292 private:
293  const T& _data;
294  const M& _man;
295 };
296 
297 template <class T, class M>
299  { p.man().print(p.data(), out); return out; }
300 
301 template <class T, class M>
302 inline Printable<T, M> p(const T& data, const M& man) { return Printable<T, M>(data, man); }
303 
304 
305 // output of list (with separators)
306 template <class T>
307 struct ListPrinter {
308  typedef const typename T::t& t;
309  typedef std::function<void(io::Output& out, t x)> fun_t;
310  inline ListPrinter(const T& list, cstring sep = " ", fun_t fun = asis)
311  : l(list), s(sep), f(fun) { }
312  const T& l;
315  static inline void asis(io::Output& out, t x) { out << x; }
316  void print(io::Output& out) const
317  { bool c = true; for(auto x: l) { if(c) c = false; else out << s; f(out, x); } }
318 };
319 
320 template <class T>
321 inline ListPrinter<T> list(const T& l, cstring s = "", typename ListPrinter<T>::fun_t f = ListPrinter<T>::asis)
322  { return ListPrinter<T>(l, s, f); }
323 
324 template <class T>
326  bool f = true;
327  for(auto x: l.l) {
328  if(f) f = false; else out << l.s;
329  l.f(out, x);
330  }
331  return out;
332 }
333 
334 // End-of-line
335 extern const EOL endl;
336 
337 // predefined styles
338 IntFormat pointer(const void *p);
340 extern FloatFormat percent;
341 
342 } } // elm::io
343 
344 #endif // ELM_IO_OUTPUT_H
345 
elm::io::FloatFormat::scientific
FloatFormat & scientific(void)
Definition: Output.h:129
elm::io::IntFormat::_displaySign
unsigned _displaySign
Definition: Output.h:102
elm::io::Output::print
void print(bool value)
Definition: io_Output.cpp:138
elm::io::FloatFormat::operator()
FloatFormat operator()(double val)
Definition: Output.h:122
elm::io::width
IntFormat width(int width, IntFormat fmt)
Definition: Output.h:261
elm::io::FloatFormat::align
FloatFormat & align(alignment_t a)
Definition: Output.h:130
elm::enum_info
Definition: enum_info.h:30
elm::io::RIGHT
@ RIGHT
Definition: Output.h:45
elm::io::FloatFormat::left
FloatFormat & left(void)
Definition: Output.h:131
elm::io::FloatFormat::upper
FloatFormat & upper(void)
Definition: Output.h:134
elm::io::IntFormat::IntFormat
IntFormat(t::int32 value)
Definition: Output.h:67
elm::io::Printable::Printable
Printable(const T &data, const M &man)
Definition: Output.h:289
elm::io::IntFormat::_sign
unsigned _sign
Definition: Output.h:101
elm::_if
Definition: meta.h:43
elm::io::def_printer
Definition: Output.h:214
elm::io::p
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
elm::io::FloatFormat
Definition: Output.h:109
elm::io::StringFormat::left
StringFormat & left(void)
Definition: Output.h:160
elm::io::StringFormat::width
StringFormat & width(int w)
Definition: Output.h:158
elm::io::FloatFormat::style
FloatFormat & style(style_t s)
Definition: Output.h:126
elm::io::IntFormat::operator()
IntFormat operator()(t::uint8 value)
Definition: Output.h:73
elm::io::StringFormat::_width
unsigned char _width
Definition: Output.h:166
elm::io::out
sys::SystemOutStream & out
Definition: system_SystemIO.cpp:122
elm::io::IntFormat::hex
IntFormat & hex(void)
Definition: Output.h:85
elm::io::Tag::print
void print(io::Output &out) const
Definition: Output.h:247
elm::io::StringFormat::StringFormat
StringFormat(void)
Definition: Output.h:154
elm::io::LEFT
@ LEFT
Definition: Output.h:43
elm::t::int32
int int32
Definition: arch.h:30
elm::t::uint16
unsigned short uint16
Definition: arch.h:29
elm::io::FloatFormat::_align
unsigned char _align
Definition: Output.h:142
elm::io::Output::format
void format(CString fmt,...)
Definition: io_Output.cpp:309
elm::io::byte
IntFormat byte(t::uint8 b)
Definition: io_Output.cpp:889
elm::io::base
IntFormat base(int base, IntFormat fmt)
Definition: Output.h:256
elm::io::NONE
@ NONE
Definition: Output.h:42
elm::io::EOL
Definition: Output.h:38
elm::io::StringFormat::StringFormat
StringFormat(string str)
Definition: Output.h:155
elm::io::IntFormat::_val
t::int64 _val
Definition: Output.h:96
elm::io::percent
FloatFormat percent
Definition: io_Output.cpp:897
elm::io::FloatFormat::_val
double _val
Definition: Output.h:138
elm::io::bin
IntFormat bin(IntFormat fmt)
Definition: Output.h:257
elm::t::int64
long int64
Definition: arch.h:32
elm::io::IntFormat::_align
unsigned _align
Definition: Output.h:99
elm::io::IntFormat::operator()
IntFormat operator()(t::uint32 value)
Definition: Output.h:77
elm::io::enum_printer::print
static void print(Output &out, const T &v)
Definition: Output.h:215
elm::io::FloatFormat::_decw
unsigned char _decw
Definition: Output.h:140
elm::io::pointer
IntFormat pointer(const void *p)
Definition: io_Output.cpp:871
elm::io::ListPrinter::f
fun_t f
Definition: Output.h:314
elm::io::oct
IntFormat oct(IntFormat fmt)
Definition: Output.h:258
elm::io::IntFormat::operator()
IntFormat operator()(t::int16 value)
Definition: Output.h:74
elm::io::StringFormat::center
StringFormat & center(void)
Definition: Output.h:161
value
void
elm::io::IntFormat::IntFormat
IntFormat(t::int8 value)
Definition: Output.h:63
elm::io::IntFormat::IntFormat
IntFormat(t::uint16 value)
Definition: Output.h:66
elm::io::FloatFormat::operator()
FloatFormat operator()(float val)
Definition: Output.h:121
elm::CString
Definition: CString.h:17
elm::io::IntFormat::width
IntFormat & width(int w)
Definition: Output.h:86
elm::io::pad
IntFormat pad(char pad, IntFormat fmt)
Definition: Output.h:266
elm::io::FloatFormat::decimal
FloatFormat & decimal(void)
Definition: Output.h:128
elm::io::Output::print
void print(const char *str)
Definition: Output.h:191
elm::io::Tag::t
cstring t
Definition: Output.h:245
elm::io::IntFormat::operator()
IntFormat operator()(t::int8 value)
Definition: Output.h:72
elm::t::int16
short int16
Definition: arch.h:28
elm::io::IntFormat::base
IntFormat & base(int b)
Definition: Output.h:81
elm::io::operator<<
Output & operator<<(Output &out, const T &v)
Definition: Output.h:216
elm::io::IntFormat::_width
unsigned char _width
Definition: Output.h:98
elm::io::StringFormat::_align
unsigned char _align
Definition: Output.h:167
elm::io::StringFormat::operator()
StringFormat & operator()(string str)
Definition: Output.h:157
elm::io::IntFormat::IntFormat
IntFormat()
Definition: Output.h:61
elm::io::Output::setStream
void setStream(OutStream &stream)
Definition: io_Output.cpp:117
elm::io::IntFormat::oct
IntFormat & oct(void)
Definition: Output.h:83
elm::io::IntFormat::center
IntFormat & center(void)
Definition: Output.h:89
elm::io::ListPrinter::s
cstring s
Definition: Output.h:313
elm::io::IntFormat::_upper
unsigned _upper
Definition: Output.h:100
elm::io::FloatFormat::width
FloatFormat & width(int w, int d)
Definition: Output.h:125
elm::io::ListPrinter::ListPrinter
ListPrinter(const T &list, cstring sep=" ", fun_t fun=asis)
Definition: Output.h:310
elm::io::ListPrinter::asis
static void asis(io::Output &out, t x)
Definition: Output.h:315
elm::io::Output::supportsANSI
bool supportsANSI()
Definition: io_Output.cpp:127
elm::io::IntFormat::bin
IntFormat & bin(void)
Definition: Output.h:82
elm::io::list
ListPrinter< T > list(const T &l, cstring s="", typename ListPrinter< T >::fun_t f=ListPrinter< T >::asis)
Definition: Output.h:321
elm
Definition: adapter.h:26
elm::io::alignment_t
alignment_t
Definition: Output.h:41
elm::io::IntFormat::IntFormat
IntFormat(t::int64 value)
Definition: Output.h:69
elm::io::IntFormat::operator()
IntFormat operator()(t::int32 value)
Definition: Output.h:76
elm::io::IntFormat::left
IntFormat & left(void)
Definition: Output.h:88
elm::io::IntFormat::operator()
IntFormat operator()(t::uint16 value)
Definition: Output.h:75
elm::t::uint64
unsigned long uint64
Definition: arch.h:33
elm::io::FloatFormat::DECIMAL
@ DECIMAL
Definition: Output.h:113
elm::io::IntFormat::operator()
IntFormat operator()(t::int64 value)
Definition: Output.h:78
elm::io::align
IntFormat align(alignment_t align, IntFormat fmt)
Definition: Output.h:262
elm::io::FloatFormat::_upper
unsigned char _upper
Definition: Output.h:143
elm::io::uppercase
IntFormat uppercase(IntFormat fmt)
Definition: Output.h:267
elm::t::size
uint64 size
Definition: arch.h:35
elm::io::Printable::man
const M & man(void) const
Definition: Output.h:291
elm::io::Tag
Definition: Output.h:243
elm::io::IntFormat
Definition: Output.h:49
elm::io::center
IntFormat center(IntFormat fmt)
Definition: Output.h:265
elm::io::endl
const EOL endl
Definition: io_Output.cpp:880
elm::io::OutStream
Definition: OutStream.h:30
elm::io::IntFormat::operator()
IntFormat operator()(t::uint64 value)
Definition: Output.h:79
elm::io::StringFormat::pad
StringFormat & pad(char p)
Definition: Output.h:163
elm::io::sign
IntFormat sign(IntFormat fmt)
Definition: Output.h:260
elm::VarArg
Definition: VarArg.h:25
elm::io::FloatFormat::FloatFormat
FloatFormat(double val)
Definition: Output.h:119
elm::io::Printable
Definition: Output.h:287
elm::io::IntFormat::align
IntFormat & align(alignment_t a)
Definition: Output.h:87
elm::t::uint8
unsigned char uint8
Definition: arch.h:27
elm::io::FloatFormat::pad
FloatFormat & pad(char p)
Definition: Output.h:136
elm::io::fmt
IntFormat fmt(t::int8 i)
Definition: Output.h:271
elm::io::Output::Output
Output(void)
Definition: io_Output.cpp:98
elm::io::FloatFormat::FloatFormat
FloatFormat(float val)
Definition: Output.h:118
elm::io::FloatFormat::width
FloatFormat & width(int w)
Definition: Output.h:124
elm::io::StringFormat::s
string s
Definition: Output.h:165
elm::t::uint32
unsigned int uint32
Definition: arch.h:31
elm::io::lowercase
IntFormat lowercase(IntFormat fmt)
Definition: Output.h:268
elm::io::IntFormat::pad
IntFormat & pad(char p)
Definition: Output.h:94
elm::io::FloatFormat::_width
unsigned char _width
Definition: Output.h:139
elm::io::IntFormat::IntFormat
IntFormat(t::uint32 value)
Definition: Output.h:68
elm::io::CENTER
@ CENTER
Definition: Output.h:44
elm::io::ListPrinter::fun_t
std::function< void(io::Output &out, t x)> fun_t
Definition: Output.h:309
elm::io::FloatFormat::_pad
unsigned char _pad
Definition: Output.h:144
elm::String
Definition: String.h:30
elm::io::ListPrinter::print
void print(io::Output &out) const
Definition: Output.h:316
elm::io::IntFormat::_size
char _size
Definition: Output.h:104
elm::io::ListPrinter::l
const T & l
Definition: Output.h:312
elm::io::IntFormat::IntFormat
IntFormat(t::int16 value)
Definition: Output.h:65
elm::io::enum_printer
Definition: Output.h:215
elm::io::FloatFormat::FloatFormat
FloatFormat(void)
Definition: Output.h:117
elm::io::ListPrinter
Definition: Output.h:307
elm::io::def_printer::print
static void print(Output &out, const T &v)
Definition: Output.h:214
elm::io::FloatFormat::SHORTEST
@ SHORTEST
Definition: Output.h:112
elm::io::IntFormat::right
IntFormat & right(void)
Definition: Output.h:90
elm::io::FloatFormat::style_t
style_t
Definition: Output.h:111
elm::io::FloatFormat::_style
unsigned char _style
Definition: Output.h:141
elm::io::ListPrinter::t
const typedef T::t & t
Definition: Output.h:308
elm::io::Output::stream
OutStream & stream(void) const
Definition: Output.h:183
elm::io::FloatFormat::SCIENTIFIC
@ SCIENTIFIC
Definition: Output.h:114
elm::io::IntFormat::lower
IntFormat & lower(void)
Definition: Output.h:92
elm::io::Output::flush
void flush(void)
Definition: io_Output.cpp:298
elm::io::IntFormat::upper
IntFormat & upper(void)
Definition: Output.h:91
elm::str
string str(const char *s)
Definition: String.h:150
elm::io::StringFormat::right
StringFormat & right(void)
Definition: Output.h:162
elm::io::Tag::Tag
Tag(const typename P::t &val)
Definition: Output.h:246
elm::io::right
IntFormat right(IntFormat fmt)
Definition: Output.h:264
elm::io::FloatFormat::shortest
FloatFormat & shortest(void)
Definition: Output.h:127
elm::io::IntFormat::_base
unsigned char _base
Definition: Output.h:97
elm::io::hex
IntFormat hex(IntFormat fmt)
Definition: Output.h:259
elm::io::left
IntFormat left(IntFormat fmt)
Definition: Output.h:263
elm::io::IntFormat::dec
IntFormat & dec(void)
Definition: Output.h:84
elm::io::StringFormat::_pad
unsigned char _pad
Definition: Output.h:168
elm::io::Printable::data
const T & data(void) const
Definition: Output.h:290
elm::io::FloatFormat::lower
FloatFormat & lower(void)
Definition: Output.h:135
elm::io::Output
Definition: Output.h:179
elm::io::IntFormat::_pad
char _pad
Definition: Output.h:103
elm::io::IntFormat::IntFormat
IntFormat(t::uint8 value)
Definition: Output.h:64
elm::io::FloatFormat::right
FloatFormat & right(void)
Definition: Output.h:133
elm::io::FloatFormat::center
FloatFormat & center(void)
Definition: Output.h:132
elm::t::int8
signed char int8
Definition: arch.h:26
elm::io::StringFormat::align
StringFormat & align(alignment_t a)
Definition: Output.h:159
elm::io::IntFormat::IntFormat
IntFormat(t::uint64 value)
Definition: Output.h:70
elm::io::IntFormat::sign
IntFormat & sign(void)
Definition: Output.h:93
elm::io::StringFormat
Definition: Output.h:152