|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
22 #ifndef ELM_IO_OUTPUT_H
23 #define ELM_IO_OUTPUT_H
28 #include <elm/enum_info.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>
36 namespace elm {
namespace io {
50 inline void init(
bool s,
int size) {
188 void print(
char chr);
219 {
out.print((
void *)v);
return out; }
246 inline Tag(
const typename P::t& val): v(val) { }
249 const typename P::t v;
286 template <
class T,
class M>
290 inline const T&
data(
void)
const {
return _data; }
291 inline const M&
man(
void)
const {
return _man; }
297 template <
class T,
class M>
299 {
p.man().print(
p.data(),
out);
return out; }
301 template <
class T,
class M>
308 typedef const typename T::t&
t;
317 {
bool c =
true;
for(
auto x:
l) {
if(c) c =
false;
else out <<
s;
f(
out, x); } }
328 if(f) f =
false;
else out << l.
s;
344 #endif // ELM_IO_OUTPUT_H
void print(bool value)
Definition: io_Output.cpp:138
IntFormat width(int width, IntFormat fmt)
Definition: Output.h:261
Definition: enum_info.h:30
@ RIGHT
Definition: Output.h:45
Printable(const T &data, const M &man)
Definition: Output.h:289
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
sys::SystemOutStream & out
Definition: system_SystemIO.cpp:122
void print(io::Output &out) const
Definition: Output.h:247
@ LEFT
Definition: Output.h:43
int int32
Definition: arch.h:30
unsigned short uint16
Definition: arch.h:29
void format(CString fmt,...)
Definition: io_Output.cpp:309
IntFormat byte(t::uint8 b)
Definition: io_Output.cpp:889
IntFormat base(int base, IntFormat fmt)
Definition: Output.h:256
@ NONE
Definition: Output.h:42
FloatFormat percent
Definition: io_Output.cpp:897
IntFormat bin(IntFormat fmt)
Definition: Output.h:257
long int64
Definition: arch.h:32
static void print(Output &out, const T &v)
Definition: Output.h:215
IntFormat pointer(const void *p)
Definition: io_Output.cpp:871
fun_t f
Definition: Output.h:314
IntFormat oct(IntFormat fmt)
Definition: Output.h:258
IntFormat pad(char pad, IntFormat fmt)
Definition: Output.h:266
void print(const char *str)
Definition: Output.h:191
cstring t
Definition: Output.h:245
short int16
Definition: arch.h:28
Output & operator<<(Output &out, const T &v)
Definition: Output.h:216
void setStream(OutStream &stream)
Definition: io_Output.cpp:117
cstring s
Definition: Output.h:313
ListPrinter(const T &list, cstring sep=" ", fun_t fun=asis)
Definition: Output.h:310
static void asis(io::Output &out, t x)
Definition: Output.h:315
bool supportsANSI()
Definition: io_Output.cpp:127
ListPrinter< T > list(const T &l, cstring s="", typename ListPrinter< T >::fun_t f=ListPrinter< T >::asis)
Definition: Output.h:321
alignment_t
Definition: Output.h:41
unsigned long uint64
Definition: arch.h:33
IntFormat align(alignment_t align, IntFormat fmt)
Definition: Output.h:262
IntFormat uppercase(IntFormat fmt)
Definition: Output.h:267
uint64 size
Definition: arch.h:35
const M & man(void) const
Definition: Output.h:291
IntFormat center(IntFormat fmt)
Definition: Output.h:265
const EOL endl
Definition: io_Output.cpp:880
Definition: OutStream.h:30
IntFormat sign(IntFormat fmt)
Definition: Output.h:260
unsigned char uint8
Definition: arch.h:27
IntFormat fmt(t::int8 i)
Definition: Output.h:271
Output(void)
Definition: io_Output.cpp:98
unsigned int uint32
Definition: arch.h:31
IntFormat lowercase(IntFormat fmt)
Definition: Output.h:268
@ CENTER
Definition: Output.h:44
std::function< void(io::Output &out, t x)> fun_t
Definition: Output.h:309
void print(io::Output &out) const
Definition: Output.h:316
const T & l
Definition: Output.h:312
static void print(Output &out, const T &v)
Definition: Output.h:214
const typedef T::t & t
Definition: Output.h:308
OutStream & stream(void) const
Definition: Output.h:183
void flush(void)
Definition: io_Output.cpp:298
string str(const char *s)
Definition: String.h:150
Tag(const typename P::t &val)
Definition: Output.h:246
IntFormat right(IntFormat fmt)
Definition: Output.h:264
IntFormat hex(IntFormat fmt)
Definition: Output.h:259
IntFormat left(IntFormat fmt)
Definition: Output.h:263
const T & data(void) const
Definition: Output.h:290
signed char int8
Definition: arch.h:26