Confdump Agent  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Public Member Functions | Private Member Functions | Private Attributes
Confdump::Formatter Class Reference

Formats results towards output (XML, text, ...) More...

#include <Formatter.hpp>

Inheritance diagram for Confdump::Formatter:
Confdump::TextFormatter Confdump::XmlFormatter

List of all members.

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_

Detailed Description

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.


Constructor & Destructor Documentation

Definition at line 25 of file Formatter.cpp.

Definition at line 29 of file Formatter.cpp.


Member Function Documentation

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().

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.

  • identifier A unique computer identifier

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.

Parameters:
titleThe table title
resultThe 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.

References device(), and device_.


Member Data Documentation

boost::shared_ptr<QIODevice> Confdump::Formatter::device_ [private]

Definition at line 80 of file Formatter.hpp.

Referenced by device(), and setDevice().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends