Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Report Class Reference

The abstract report class. More...

#include <report.h>

Inheritance diagram for Report:

Parameter asciiReport htmlReport List of all members.

Public Types

enum  reportType_e { TABLE }
 All report types. More...

enum  colTyp_e {
  COUNTER, STRING, INTEGER, FLOAT,
  PERCENT, DATE
}
 All column types. More...

enum  colStyle_e { NONE, ROUND, RECT, QUOTE }
 Styles for every column. More...

enum  colAlign_e { LEFT, RIGHT }
 Aligments for every column. More...

enum  { SUM = 1 }
 Addiotional Flag for special views. More...


Public Methods

 Report ()
virtual void startNewReport (const std::string &title, const reportType_e reportType)=0
virtual void addCol (const int colSize, const colTyp_e colTyp, const colAlign_e colAlign, const std::string &colTitle, const colStyle_e colStyle, const unsigned long colFlags=0)
virtual void printPageHeader (void)=0
virtual void printHeader (void)=0
virtual void printField (const std::string &field)=0
virtual void printField (const long field)=0
virtual void printField (const double field)=0
virtual void skipField (const bool realline=true)=0
virtual void printFooter (void)=0
virtual void printPageFooter (void)=0
virtual void setOstream (std::ostream *newos)
virtual std::ostream * getOstream (void)
virtual ~Report ()

Protected Methods

std::string getDateStr (time_t t)
int getDateLenght (void)

Protected Attributes

std::ostream * os
std::list< col_tcol_list
std::list< col_t >::iterator ci
long lc
std::string Title
reportType_e Type

Private Methods

void checkDateformat (void)

Private Attributes

std::string dateformat
int datesize

Detailed Description

The abstract report class.

The is the abstract report class. Every report is itherited from this class.

Author:
Tobias Erbsland


Member Enumeration Documentation

anonymous enum
 

Addiotional Flag for special views.

Enumeration values:
SUM 

enum Report::colAlign_e
 

Aligments for every column.

Enumeration values:
LEFT 
RIGHT 

enum Report::colStyle_e
 

Styles for every column.

Enumeration values:
NONE 
ROUND 
RECT 
QUOTE 

enum Report::colTyp_e
 

All column types.

Enumeration values:
COUNTER 
STRING 
INTEGER 
FLOAT 
PERCENT 
DATE 

enum Report::reportType_e
 

All report types.

Enumeration values:
TABLE 


Constructor & Destructor Documentation

Report::Report  
 

The constructor sets the output stream pointer default to 0. Please check this in every function implementation, for security reasons.

Report::~Report   [virtual]
 

The virtual deconstructor.


Member Function Documentation

void Report::addCol const int    colSize,
const colTyp_e    colTyp,
const colAlign_e    colAlign,
const std::string &    colTitle,
const colStyle_e    colStyle,
const unsigned long    colFlags = 0
[virtual]
 

Is the report type a "table", after starting a new Report (call startNewReport), you must add every column of the table with this function.

Parameters:
colSize  For a fixed width column this is a positive integer, with the Value -1 you can create a dynamic sized column. This value means only the minimal width of the column.
colTyp  Set here the Type of the column.
colAlign  Set here the Align of the column.
colTitle  Every column is labled with a Title. Set the Title here. Make sure the Title is noch Bigger than the colSize.
colStyle  Here you can set special formating options, like (xxx) or [xxx].
colFlags  This parameter is optional for special Flags like SUM or others.

void Report::checkDateformat void    [private]
 

int Report::getDateLenght void    [protected]
 

Check how many chars the datestring need.

std::string Report::getDateStr time_t    t [protected]
 

Convert a unix timestamp to a string.

virtual std::ostream* Report::getOstream void    [inline, virtual]
 

This function is only used by some Plugins. Don't use it in analyse modules!

virtual void Report::printField const double    field [pure virtual]
 

Implemented in asciiReport, and htmlReport.

virtual void Report::printField const long    field [pure virtual]
 

Implemented in asciiReport, and htmlReport.

virtual void Report::printField const std::string &    field [pure virtual]
 

If you create a Table, after setup all columns and calling printHeader, you must fill every Field auf the table (except autofilled-colums) with the right value from left to right, top to bottom.

Implemented in asciiReport, and htmlReport.

virtual void Report::printFooter void    [pure virtual]
 

After the last line of the table, call this function to create perhaps a footer.

Implemented in asciiReport, and htmlReport.

virtual void Report::printHeader void    [pure virtual]
 

After setup all columns with addCol, you must call this function. It's possible this function creates a header for the Report.

Implemented in asciiReport, and htmlReport.

virtual void Report::printPageFooter void    [pure virtual]
 

Generate a final Footer before closing a stream

Implemented in asciiReport, and htmlReport.

virtual void Report::printPageHeader void    [pure virtual]
 

Gererate a page Header for one or more single Reports

Implemented in asciiReport, and htmlReport.

virtual void Report::setOstream std::ostream *    newos [inline, virtual]
 

This function is only used by some Plugins. Don't use it in analyse modules!

virtual void Report::skipField const bool    realline = true [pure virtual]
 

If the Field empty, call this function. You can choose between a realline or not. See the examples in the current analyse modules.

Implemented in asciiReport, and htmlReport.

void Report::startNewReport const std::string &    title,
const reportType_e    reportType
[pure virtual]
 

This function must be called first, before any other function is called. With this, important parameters would be set.

Parameters:
title  Set the title of the following report.
reportType  Set the next report type.

Implemented in asciiReport, and htmlReport.


Member Data Documentation

std::list< col_t >::iterator Report::ci [protected]
 

Pointer to the current column.

std::list< col_t > Report::col_list [protected]
 

This is the list used for column declarations.

std::string Report::dateformat [private]
 

int Report::datesize [private]
 

long Report::lc [protected]
 

Linecounter.

std::ostream* Report::os [protected]
 

Pointer to the default Output stream.

std::string Report::Title [protected]
 

The string for the Report title.

reportType_e Report::Type [protected]
 

The report Type.


The documentation for this class was generated from the following files:
Generated on Wed Oct 15 13:54:52 2003 for Anteater.kdevelop by doxygen1.2.18