Confdump Agent
1.4.0
|
Human-friendly formatter. More...
#include <TextFormatter.hpp>
Public Member Functions | |
TextFormatter () | |
virtual | ~TextFormatter () |
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 | doPrintTable (QString title, const Result &result) |
Human-friendly formatter.
This formatter happens to procude an output closely related to YAML (and might actually be valid, although it hasn't been tested for that purpose).
Note that binary data is stripped from the output, while other formatters like XmlFormatter include it.
Example:
CD_Socket: - inode: 0 localAddressString: 0.0.0.0:22 protocolName: tcp remoteAddressString: 0.0.0.0:0 stateString: LISTEN
The interface is documented in the Formatter base class.
Definition at line 49 of file TextFormatter.hpp.
Definition at line 68 of file TextFormatter.cpp.
Confdump::TextFormatter::~TextFormatter | ( | ) | [virtual] |
Definition at line 72 of file TextFormatter.cpp.
boost::shared_ptr< QIODevice > Confdump::Formatter::device | ( | ) | const [inherited] |
A QIODevice to write to.
Definition at line 38 of file Formatter.cpp.
References Confdump::Formatter::device_.
Referenced by Confdump::XmlFormatter::doPrintHeader(), and Confdump::Formatter::setDevice().
void Confdump::TextFormatter::doPrintTable | ( | QString | title, |
const Result & | result | ||
) | [private, virtual] |
Implements Confdump::Formatter.
Definition at line 76 of file TextFormatter.cpp.
References Confdump::Result::propertyNames(), and Confdump::Result::propertyValues().
void Confdump::Formatter::printFooter | ( | ) | [inherited] |
Call this once after printing the tables.
Definition at line 53 of file Formatter.cpp.
References Confdump::Formatter::doPrintFooter().
void Confdump::Formatter::printHeader | ( | QString | identifier | ) | [inherited] |
Call this once before printing the tables.
Definition at line 43 of file Formatter.cpp.
References Confdump::Formatter::doPrintHeader().
void Confdump::Formatter::printTable | ( | QString | title, |
const Result & | result | ||
) | [inherited] |
Call this for each table to format.
title | The table title |
result | The table itself |
Definition at line 48 of file Formatter.cpp.
References Confdump::Formatter::doPrintTable().
void Confdump::Formatter::setDevice | ( | boost::shared_ptr< QIODevice > | device | ) | [inherited] |
A QIODevice to write to.
Definition at line 33 of file Formatter.cpp.
References Confdump::Formatter::device(), and Confdump::Formatter::device_.