Elm
2
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 | print (const StringFormat &fmt) |
void | format (CString fmt,...) |
void | format (CString fmt, VarArg &args) |
bool | supportsANSI () |
void | print (t::int32 value) |
void | print (t::uint32 value) |
void | print (t::int64 value) |
void | print (t::uint64 value) |
Class providing formatted output.
Beside a set of print() functions, this class also supports a collection of format configuration classes:
Below is an example of the use of these classes:
Additionally, this class provides simple facilities to output to a file and to manage release of created streams.
Flush the underlying stream.
IOException | If there is a stream error. |
References OutStream::flush(), and OutStream::lastErrorMessage().
Referenced by Saver::close(), VarExpander::expand(), Serializer::flush(), and elm::trace().
Print a formatted string a-la C prinf().
fmt | Format string. |
args | Other arguments. |
References VarArg::args(), elm::io::fmt(), and OutStream::write().
Print a formatted string a-la C prinf().
fmt | Format string. |
... | Other arguments. |
References elm::io::fmt().
Print a boolean value, 'true' or 'false'.
value | Value to write. |
Referenced by Output::print().
void print | ( | char | chr | ) |
Print a character.
chr | Character to print. |
References OutStream::lastErrorMessage(), and OutStream::write().
|
inline |
References Output::print(), and elm::str().
Referenced by Output::print().
Print a C string.
str | C string to print. |
References String::chars(), OutStream::lastErrorMessage(), String::length(), elm::str(), and OutStream::write().
void print | ( | const FloatFormat & | fmt | ) |
Print a float with the given format.
fmt | Float format to print. |
References IntFormat::_align, IntFormat::_pad, IntFormat::_val, IntFormat::_width, elm::io::CENTER, FloatFormat::DECIMAL, elm::io::fmt(), elm::io::LEFT, elm::max(), elm::io::NONE, elm::io::p(), elm::io::RIGHT, FloatFormat::SCIENTIFIC, elm::array::set(), and OutStream::write().
Print a formatted long value.
fmt | Formatted value to display. |
References IntFormat::_align, IntFormat::_base, IntFormat::_displaySign, IntFormat::_pad, IntFormat::_sign, IntFormat::_size, IntFormat::_upper, IntFormat::_val, IntFormat::_width, elm::io::CENTER, elm::io::fmt(), elm::io::LEFT, elm::io::NONE, elm::io::RIGHT, and OutStream::write().
Print a string.
str | String to print. |
References String::chars(), OutStream::lastErrorMessage(), String::length(), elm::str(), and OutStream::write().
void print | ( | const StringFormat & | fmt | ) |
Print a formatted string.
fmt | Format to print. |
References IntFormat::_align, IntFormat::_pad, IntFormat::_width, elm::io::CENTER, elm::io::fmt(), elm::io::LEFT, and elm::io::RIGHT.
void print | ( | double | value | ) |
Print a double value.
value | Double value to print. |
References OutStream::lastErrorMessage(), and OutStream::write().
Print an integer.
value | Integer to print. |
References OutStream::lastErrorMessage(), elm::io::p(), and OutStream::write().
Print a long long integer.
value | Long long integer to print. |
References OutStream::lastErrorMessage(), elm::io::p(), and OutStream::write().
Print an unsigned integer.
value | Integer to print. |
References OutStream::lastErrorMessage(), elm::io::p(), and OutStream::write().
Print an unsigned long long integer.
value | Integer to print. |
References OutStream::lastErrorMessage(), elm::io::p(), and OutStream::write().
Print a pointer.
value | Pointer value. |
References OutStream::lastErrorMessage(), elm::io::p(), Output::print(), and OutStream::write().
Change the output stream of the current output object.
stream | New stream to use. |
References Output::stream().
Referenced by FileOutput::FileOutput(), Saver::Saver(), and Serializer::setOutputStream().
Get the stream used by the output.
Referenced by Output::setStream(), and Serializer::writeRaw().
bool supportsANSI | ( | ) |
Test if the current stream supports ANSI codes.
References OutStream::supportsANSI().