Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/string/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 |
void | escape (char c) |
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 :
Formatter | ( | char | escape = '%' | ) |
Build a new formatter.
escape | Escape character ('' as default). |
|
inline |
Change the escape character.
|
inline |
Get the escape character.
int 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 Formatter::CONTINUE, Formatter::DONE, InStream::ENDED, InStream::FAILED, Formatter::process(), and Formatter::REJECT.
|
protectedpure virtual |
This method must be overloaded for performing special formatting.
out | Out stream to perform output in. |
chr | Escaped character. |
Referenced by Formatter::format().
|
staticprotected |
Referenced by Formatter::format().
|
staticprotected |
Referenced by Formatter::format().
|
staticprotected |
Referenced by Formatter::format().