Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/io/Output.h>
Public Member Functions | |
Output (void) | |
Output (OutStream &stream) | |
OutStream & | stream (void) const |
void | setStream (OutStream &stream) |
void | flush (void) |
void | print (bool value) |
void | print (char chr) |
void | print (double value) |
void | print (void *value) |
void | print (const char *str) |
void | print (const CString str) |
void | print (const String &str) |
void | print (const IntFormat &fmt) |
void | print (const FloatFormat &fmt) |
void | format (CString fmt,...) |
void | format (CString fmt, VarArg &args) |
void | print (t::int32 value) |
void | print (t::uint32 value) |
void | print (t::int64 value) |
void | print (t::uint64 value) |
Formatted output class.
Formatting integers is maded using the class IntFormat that embeds the value to display and the format configuration. Then the result object is passed to the Output object that will perform the actual formatting of the output as in the example below.
elm::io::Output::Output | ( | void | ) |
Build a formatted output on the standard output.
elm::io::Output::Output | ( | OutStream & | stream | ) |
Build a formatted output on the given stream.
void elm::io::Output::flush | ( | void | ) |
Flush the underlying stream.
IOException | If there is a stream error. |
References elm::io::OutStream::flush(), and elm::io::OutStream::lastErrorMessage().
Referenced by elm::xom::Serializer::flush(), and elm::trace().
void elm::io::Output::format | ( | CString | fmt, |
... | |||
) |
Print a formatted string a-la C prinf().
fmt | Format string. |
... | Other arguments. |
Print a formatted string a-la C prinf().
fmt | Format string. |
args | Other arguments. |
References elm::VarArg::args(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | bool | value | ) |
Print a boolean value, 'true' or 'false'.
value | Value to write. |
Referenced by elm::io::operator<<(), print(), elm::io::def_printer< T >::print(), and elm::io::enum_printer< T >::print().
void elm::io::Output::print | ( | char | chr | ) |
Print a character.
chr | Character to print. |
References elm::io::OutStream::lastErrorMessage(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | double | value | ) |
Print a double value.
value | Double value to print. |
References elm::io::OutStream::lastErrorMessage(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | void * | value | ) |
Print a pointer.
value | Pointer value. |
References elm::io::OutStream::lastErrorMessage(), print(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | const CString | str | ) |
Print a C string.
str | C string to print. |
References elm::CString::chars(), elm::io::OutStream::lastErrorMessage(), elm::CString::length(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | const String & | str | ) |
Print a string.
str | String to print. |
References elm::String::chars(), elm::io::OutStream::lastErrorMessage(), elm::String::length(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | const IntFormat & | fmt | ) |
Print a formatted long value.
fmt | Formatted value to display. |
References elm::io::IntFormat::_align, elm::io::IntFormat::_base, elm::io::IntFormat::_displaySign, elm::io::IntFormat::_pad, elm::io::IntFormat::_sign, elm::io::IntFormat::_size, elm::io::IntFormat::_upper, elm::io::IntFormat::_val, elm::io::IntFormat::_width, elm::io::CENTER, elm::io::LEFT, elm::io::NONE, elm::io::RIGHT, and elm::io::OutStream::write().
void elm::io::Output::print | ( | const FloatFormat & | fmt | ) |
Print a float with the given format.
fmt | Float format to print. |
References elm::io::FloatFormat::_align, elm::io::FloatFormat::_decw, elm::io::FloatFormat::_pad, elm::io::FloatFormat::_style, elm::io::FloatFormat::_val, elm::io::FloatFormat::_width, elm::abs(), elm::io::CENTER, elm::io::FloatFormat::DECIMAL, elm::io::LEFT, elm::max(), elm::io::RIGHT, elm::io::FloatFormat::SCIENTIFIC, elm::io::FloatFormat::SHORTEST, stream(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | t::int32 | value | ) |
Print an integer.
value | Integer to print. |
References elm::io::OutStream::lastErrorMessage(), elm::value(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | t::uint32 | value | ) |
Print an unsigned integer.
value | Integer to print. |
References elm::io::OutStream::lastErrorMessage(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | t::int64 | value | ) |
Print a long long integer.
value | Long long integer to print. |
References elm::io::OutStream::lastErrorMessage(), elm::value(), and elm::io::OutStream::write().
void elm::io::Output::print | ( | t::uint64 | value | ) |
Print an unsigned long long integer.
value | Integer to print. |
References elm::io::OutStream::lastErrorMessage(), and elm::io::OutStream::write().
void elm::io::Output::setStream | ( | OutStream & | stream | ) |
References stream().
Referenced by elm::xom::Serializer::setOutputStream().
OutStream & elm::io::Output::stream | ( | void | ) | const |
Get the stream used by the output.
Referenced by print(), setStream(), and elm::xom::Serializer::writeRaw().