Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/util/Formatter.h>
Public Member Functions | |
Formatter (char esc= '%') | |
virtual | ~Formatter (void) |
int | format (io::InStream &in, io::OutStream &out=io::out) |
char | escape (void) const |
Protected Member Functions | |
virtual int | process (io::OutStream &out, char chr)=0 |
Static Protected Attributes | |
static const int | DONE = 0 |
static const int | CONTINUE = 1 |
static const int | REJECT = 2 |
Class for formatting some parts of a stream. The changed parts starts with an escape character ('' as default). When such a sequenceis found, the method Formatter::process() is called with the following character and may :
elm::util::Formatter::Formatter | ( | char | escape = '%' | ) |
Build a new formatter.
escape | Escape character ('' as default). |
|
virtual |
char elm::util::Formatter::escape | ( | void | ) | const |
Get the escape character.
int elm::util::Formatter::format | ( | io::InStream & | in, |
io::OutStream & | out = io::out |
||
) |
Format the given input stream to the given output stream.
in | Input stream. |
out | Output streal (default to io::stdout). |
References CONTINUE, DONE, elm::io::InStream::ENDED, elm::io::InStream::FAILED, process(), elm::io::InStream::read(), REJECT, and elm::io::OutStream::write().
|
protectedpure virtual |
This method must be overloaded for performing special formatting.
out | Out stream to perform output in. |
chr | Escaped character. |
Referenced by format().
|
staticprotected |
Referenced by format().
|
staticprotected |
Referenced by format().
|
staticprotected |
Referenced by format().