Confdump Agent
1.4.0
|
Formats results towards output (XML, text, ...) More...
#include <Formatter.hpp>
Public Member Functions | |
Formatter () | |
virtual | ~Formatter () |
void | printHeader (QString identifier) |
Call this once before printing the tables. | |
void | printTable (QString title, const Result &result) |
Call this for each table to format. | |
void | printFooter () |
Call this once after printing the tables. | |
void | setDevice (boost::shared_ptr< QIODevice >) |
A QIODevice to write to. | |
boost::shared_ptr< QIODevice > | device () const |
A QIODevice to write to. | |
Private Member Functions | |
virtual void | doPrintHeader (QString identifier) |
Default implementation: no-op. | |
virtual void | doPrintTable (QString title, const Result &result)=0 |
virtual void | doPrintFooter () |
Default implementation: no-op. | |
Private Attributes | |
boost::shared_ptr< QIODevice > | device_ |
Formats results towards output (XML, text, ...)
Usage guidelines:
Subclassing guidelines: implement at least doPrintTable(), and doPrintHeader/doPrintFooter if you need more than the default no-op behavior.
Definition at line 47 of file Formatter.hpp.
Definition at line 25 of file Formatter.cpp.
Confdump::Formatter::~Formatter | ( | ) | [virtual] |
Definition at line 29 of file Formatter.cpp.
boost::shared_ptr< QIODevice > Confdump::Formatter::device | ( | ) | const |
A QIODevice to write to.
Definition at line 38 of file Formatter.cpp.
References device_.
Referenced by Confdump::XmlFormatter::doPrintHeader(), and setDevice().
void Confdump::Formatter::doPrintFooter | ( | ) | [private, virtual] |
Default implementation: no-op.
Reimplemented in Confdump::XmlFormatter.
Definition at line 62 of file Formatter.cpp.
Referenced by printFooter().
void Confdump::Formatter::doPrintHeader | ( | QString | identifier | ) | [private, virtual] |
Default implementation: no-op.
Reimplemented in Confdump::XmlFormatter.
Definition at line 58 of file Formatter.cpp.
Referenced by printHeader().
virtual void Confdump::Formatter::doPrintTable | ( | QString | title, |
const Result & | result | ||
) | [private, pure virtual] |
Implemented in Confdump::TextFormatter, and Confdump::XmlFormatter.
Referenced by printTable().
void Confdump::Formatter::printFooter | ( | ) |
Call this once after printing the tables.
Definition at line 53 of file Formatter.cpp.
References doPrintFooter().
void Confdump::Formatter::printHeader | ( | QString | identifier | ) |
Call this once before printing the tables.
Definition at line 43 of file Formatter.cpp.
References doPrintHeader().
void Confdump::Formatter::printTable | ( | QString | title, |
const Result & | result | ||
) |
Call this for each table to format.
title | The table title |
result | The table itself |
Definition at line 48 of file Formatter.cpp.
References doPrintTable().
void Confdump::Formatter::setDevice | ( | boost::shared_ptr< QIODevice > | device | ) |
A QIODevice to write to.
Definition at line 33 of file Formatter.cpp.
boost::shared_ptr<QIODevice> Confdump::Formatter::device_ [private] |
Definition at line 80 of file Formatter.hpp.
Referenced by device(), and setDevice().