Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
Classes | |
class | elm::io::BlockInStream |
class | elm::io::BlockOutStream |
class | elm::io::InFileStream |
class | elm::io::Input |
class | elm::io::InStream |
class | elm::io::IOException |
class | elm::io::Output |
class | elm::io::IntFormat |
class | elm::io::OutStream |
class | elm::io::StreamPipe |
Functions | |
io::Output | elm::cout (io::out) |
io::Output | elm::cerr (io::err) |
IntFormat | elm::io::base (int base, IntFormat fmt) |
IntFormat | elm::io::bin (IntFormat fmt) |
IntFormat | elm::io::hex (IntFormat fmt) |
IntFormat | elm::io::width (int width, IntFormat fmt) |
IntFormat | elm::io::align (alignment_t align, IntFormat fmt) |
IntFormat | elm::io::left (IntFormat fmt) |
IntFormat | elm::io::right (IntFormat fmt) |
IntFormat | elm::io::center (IntFormat fmt) |
IntFormat | elm::io::pad (char pad, IntFormat fmt) |
IntFormat | elm::io::uppercase (IntFormat fmt) |
IntFormat | elm::io::lowercase (IntFormat fmt) |
Variables | |
io::Input | elm::cin |
io::Output | elm::cout |
io::Output | elm::cerr |
sys::SystemInStream & | elm::io::in = sys::stdin_object |
sys::SystemOutStream & | elm::io::out = sys::stdout_object |
sys::SystemOutStream & | elm::io::err = sys::stderr_object |
The input/output of ELM is a merge of the C++ standard library system and of the Java standard library. From the former, it uses the "<<" and ">>" operators overload. From the latter, it implements the two IO access: low-level classes manage streams of bytes and the high-level provides formatting facilities.
This level provides formatted input/output as in C++ standard library, that is, through the "<<" and ">>" operators. The formatted output class is Output and the formatted input class is Input.
Three global variables give access to the standard input/output:
Most basic types are supported (including String and CString). Some constants are provided for special output:
Unlike the C++ standard library, the output format is managed thrugh special formatting objects. For integer, the work is performed by IntFormat that provides display features like representation base, field width, alignment, uppercase letters for base greater than 10, signess, padding. For float values, it exists the class FloatFormat.
The errors are managed here using exception objects derivated from the IOException class.
The class IntFormat embeds the value of an integer and its format configuration. Such is usually passed to Output object and is built from a list of usual inline functions (described below):
The basic to display a formatted integer is to use a constructor inline function as io::f(). This builds an IntFormat object to display the passed integer. The format can then be modified by calling specific functions as listed below:
One way to implement the pointer of the above example is to define an inline function as this:
Notice the function io::f() that is a shortcut to create an IntFormat object.
Another way to define this format is to declare an IntFormat variable and to benefit from the overlaod of operator() of this class to pass the actual value to the format:
The low-level IO system is only responsible for exchanging streams of bytes.
All input streams must inherit from the InStream class and defines the following functions:
The errors are returned by the called functions. Either a positive value, or a value of InStream::FAILED (error on the media), or InStream::ENDED (end of the media reached). Information about the errors may be obtained by the lastErrorMessage() method.
All output streams must inherit from the OutStream class and defines the following functions:
The errors are returned as negative value by this functions. Information about the errors may be obtained by the lastErrorMessage() method.
IntFormat elm::io::align | ( | alignment_t | align, |
IntFormat | fmt | ||
) |
Used the given alignment to display the integer in its field.
align | Alignment. |
fmt | Displayed integer. |
References elm::io::IntFormat::align().
Referenced by elm::log::Debug::debugPrefix().
IntFormat elm::io::base | ( | int | base, |
IntFormat | fmt | ||
) |
Format an integer with the given base.
base | Numeric base. |
fmt | Displayed integer. |
References elm::io::IntFormat::base().
Referenced by elm::io::Input::scanULLong(), and elm::io::Input::scanULong().
IntFormat elm::io::bin | ( | IntFormat | fmt | ) |
Used a binary base to display an integer.
fmt | Displayed integer. |
References elm::io::IntFormat::bin().
IntFormat elm::io::center | ( | IntFormat | fmt | ) |
Center the integer in its field.
fmt | Displayed integer. |
References elm::io::IntFormat::center().
io::Output elm::cerr | ( | io::err | ) |
Standard error output.
io::Output elm::cout | ( | io::out | ) |
Standard output.
IntFormat elm::io::hex | ( | IntFormat | fmt | ) |
Used an hexadecimal base to display an integer.
fmt | Displayed integer. |
References elm::io::IntFormat::hex().
Referenced by elm::WAHVector::__dump(), elm::serial::TextSerializer::beginObject(), elm::SimpleGC::mark(), elm::checksum::MD5::print(), and elm::serial::TextSerializer::writePointer().
IntFormat elm::io::left | ( | IntFormat | fmt | ) |
Align the integer to the left in its field.
fmt | Displayed integer. |
References elm::io::IntFormat::left().
Referenced by elm::avl::Tree::Node::_left(), elm::avl::GenTree< T, K, C >::Iterator::next(), and elm::genstruct::GenSortedBinTree< value_t, PairAdapter< elm::String, elm::option::Option * >, C >::remove().
IntFormat elm::io::lowercase | ( | IntFormat | fmt | ) |
Select lowercase characters for digits bigger than 10.
fmt | Displayed integer. |
References elm::io::IntFormat::lower().
IntFormat elm::io::pad | ( | char | pad, |
IntFormat | fmt | ||
) |
Select the padding character.
pad | Padding character. |
fmt | Displayed integer. |
References elm::io::IntFormat::pad().
Referenced by elm::checksum::MD5::print().
IntFormat elm::io::right | ( | IntFormat | fmt | ) |
Align the integer to the right in its field.
fmt | Displayed integer. |
References elm::io::IntFormat::right().
Referenced by elm::avl::Tree::Node::_right(), elm::stree::Tree< K, T, C >::find(), elm::avl::GenTree< T, K, C >::Iterator::next(), elm::checksum::MD5::print(), and elm::genstruct::GenSortedBinTree< value_t, PairAdapter< elm::String, elm::option::Option * >, C >::remove().
IntFormat elm::io::uppercase | ( | IntFormat | fmt | ) |
Select uppercase characters for digits bigger than 10.
fmt | Displayed integer. |
References elm::io::IntFormat::upper().
IntFormat elm::io::width | ( | int | width, |
IntFormat | fmt | ||
) |
Select the width of field where the integer will be displayed to.
width | Field width. |
fmt | Displayed integer. |
References elm::io::IntFormat::width().
Referenced by elm::log::Debug::debugPrefix(), and elm::checksum::MD5::print().
io::Output elm::cerr(io::err) |
Standard error output.
Referenced by elm::option::Manager::displayHelp(), elm::elm_spy(), elm::StackAllocator::newChunk(), elm::ErrorHandler::onError(), elm::sys::Plugger::onError(), elm::sys::Plugger::onWarning(), and elm::trace().
io::Input elm::cin |
Formatted input.
io::Output elm::cout(io::out) |
Standard output.
Referenced by elm::serial2::XOMSerializer::beginField(), elm::serial2::XOMSerializer::beginObject(), elm::serial::TextSerializer::beginObject(), elm::TestCase::check_equal(), elm::TestCase::complete(), elm::avl::dump(), elm::serial2::XOMSerializer::endField(), elm::serial2::XOMSerializer::endObject(), elm::serial::TextSerializer::endObject(), elm::TestCase::failed(), elm::serial2::XOMSerializer::flush(), elm::TestCase::prepare(), elm::TestCase::require(), elm::sys::ProcessBuilder::run(), elm::TestCase::succeeded(), elm::TestCase::test(), elm::serial::TextSerializer::write(), elm::serial::TextSerializer::writeField(), and elm::serial::TextSerializer::writePointer().
sys::SystemOutStream & elm::io::err = sys::stderr_object |
Standard error stream.
Referenced by elm::sys::ProcessBuilder::run(), and elm::io::WinOutStream::write().
sys::SystemInStream & elm::io::in = sys::stdin_object |
Standard input stream.
Referenced by elm::ini::File::load(), elm::Version::operator=(), elm::operator>>(), elm::sys::Plugger::plugFile(), elm::option::IntOption::process(), elm::sys::ProcessBuilder::run(), elm::io::Input::def_scanner< T >::scan(), elm::io::Input::enum_scanner< T >::scan(), and elm::xom::XSLTransform::transformDocument().
sys::SystemOutStream & elm::io::out = sys::stdout_object |
Standard output stream.
Referenced by elm::GDBCrashHandler::handle(), elm::xom::operator<<(), elm::checksum::operator<<(), elm::option::operator<<(), elm::imm::operator<<(), elm::sys::operator<<(), elm::operator<<(), elm::io::operator<<(), elm::io::def_printer< T >::print(), elm::io::enum_printer< T >::print(), elm::sys::ProcessBuilder::run(), and elm::io::WinOutStream::write().