Diffpack Documentation


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

Reporter Class Reference

base class for report managers. More...

#include <Reporter.h>

Inheritance diagram for Reporter::

HandleId ASCIIReporter HTMLReporter LaTeXReporter HTML2Reporter List of all members.

Public Methods

virtual ~Reporter ()
virtual Reporter& header (const String &title, const String &author, bool fullpage=true, bool singlefile=true, const char *purpose=NULL)
virtual Reporter& trailer ()
virtual String getSectionRef ()=0
virtual Reporter& section (const String &txt)
virtual Reporter& section (const String &txt, const String &label)
virtual Reporter& subsection (const String &txt)=0
virtual Reporter& subsection (const String &txt, const String &label)=0
virtual Reporter& subsubsection (const String &txt)=0
virtual Reporter& subsubsection (const String &txt, const String &label)=0
virtual Reporter& pagebreak ()=0
virtual Reporter& linebreak ()=0
virtual Reporter& eject (int n=1)=0
virtual Reporter& drawline ()=0
virtual Reporter& putLabel (const String &)
virtual Reporter& putReference (const String &)
virtual Reporter& putReference (const String &, const String &)
Reporter& flush ()
virtual Reporter& beginGroup (TextStyle style)
virtual Reporter& endGroup ()
virtual String getGroup (const String &txt, TextStyle style)
virtual String cellpad (const String &s)=0
virtual String adaptString (const String &txt)
Reporter& insert (const String &txt)
Reporter& put (const String &txt)
virtual Reporter& putmathline (const String &txt)
virtual Reporter& centerline (const String &txt)=0
virtual Reporter& put (ArrayGenSimple(String) &tb)
virtual Reporter& put (ArrayGenSimple(real) &tb)
virtual Reporter& put (ArrayGenSimple(real) &tb, const String &cell_format)
virtual Reporter& put (ArrayGenSimple(real) &tb, ArrayGenSimple(String) &cell_format)
virtual Reporter& insertDocument (const String &basename)=0
virtual Reporter& insertVerbatim (const String &file)=0
virtual Reporter& beginCenter ()
virtual Reporter& endCenter ()
virtual Reporter& beginTabular (int ncols, const String &col_format)
virtual Reporter& endTabular ()
virtual Reporter& beginTable (int ncols, const String &col_format)
virtual Reporter& endTable (const String &caption, const String &label)
virtual Reporter& beginItemize ()
virtual Reporter& endItemize ()
virtual Reporter& beginEnumerate ()
virtual Reporter& endEnumerate ()
virtual Reporter& beginFigure (const String &psfilename, real cmWidth=10.0)
virtual Reporter& endFigure (const String &caption, const String &label)
virtual Reporter& beginDispmath ()
virtual Reporter& endDispmath ()
virtual String makeLabelRef (const String &label)=0
String getCurrPlotDir ()
virtual Reporter& figure (const String &psfilename, const String &caption, const String &label, real cmWidth=10.0)
virtual Reporter& figure (const Strings &psfilename, const Strings &caption, const String &common_caption, const Strings &label, real cmWidth=10.0)
Reporter& displaymath (const String &txt)
virtual void process (bool postscript=true)=0
virtual void print (bool postscript=true)=0
virtual void preview (bool postscript=true)=0

Protected Methods

void preparePlots ()
 Reporter (Os os)
 Reporter (const String &filename, const String &extension)
virtual void putTextline (const String &txt)=0
virtual void putTabularline (const String &txt)=0
virtual void putTableline (const String &txt)=0
virtual void putItemline (const String &txt)=0
virtual void putEnumline (const String &txt)=0
virtual void putFigureline (const String &txt)=0
virtual void putDispmathline (const String &txt)=0
virtual void putCenterline (const String &txt)=0
virtual bool copyFile (const String &file, const String &format)

Protected Attributes

String currPlotDir
int plotSecCount
String filename
String extension
Os os
ReporterEnvir envir
TextStyle style
Stack(ReporterEnvirenvirStack
Stack(TextStyle) styleStack
bool singlefile
String purpose
int tb_ncols
String cell_delim

Detailed Description

base class for report managers.

NAME: Reporter - base class for report managers

DESCRIPTION:

The base class describes an interface for generic report generation. Its design is influenced by document structures used by the typesetting system `\`LaTeX. However, it is a relatively easy task to put this interface on top of other systems for typesetting.


Constructor & Destructor Documentation

Reporter::Reporter ( Os os ) [protected]
 

The creation of objects belonging to a class derived from "Reporter" should usually be allocated by the "Reporter_prm create" function.

Reporter::Reporter ( const String & filename,
const String & extension ) [protected]
 

See documentation of one of the overloaded constructor.

Reporter::~Reporter ( ) [virtual]
 


Member Function Documentation

String Reporter::adaptString ( const String & txt ) [virtual]
 

Adapt the given string to prevent collisions between text and typesetting instructions. This function is used internally by "put".

Reimplemented in LaTeXReporter.

Reporter & Reporter::beginCenter ( ) [virtual]
 

Start a centered block of displayed text. All "put" operations before the next call to "endCenter" will be produce text that is centered on the line.

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::beginDispmath ( ) [virtual]
 

Starts a block of displayed text in math mode. This block is ended by a call to "endDispmath". Usually, it is more convenient to use a single call to "displaymath".

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::beginEnumerate ( ) [virtual]
 

Similar to the itemize environment, except that all items are numbered 1,2,...,n.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::beginFigure ( const String & psfilename,
real cmWidth = 10.0 ) [virtual]
 

Starts a figure block which inserts the PostScript illustration given by "psfilename". The figure is scaled to have a width of "cmWidth" centimeters. This environment must be ended by a call to "endFigure". Usually, we perform these actions by a single call to the function "figure". Note that inclusion of figures may not be possible for all types of report classes. In these cases, the figure environment is neglected and its use result in a warning message. The parameters "caption" and "label" in "endTable" are used to generate a table caption and adding a label for easy reference.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::beginGroup ( TextStyle style ) [virtual]
 

Inserts a formatting instruction to obtain the effect indicated by the parameter "style". The reverse effect is obtained when closing the text group by a call to "endGroup". Text style groups may be nested. When using the "MATHTEXT" style, it is possible to generate inline mathematics, see also "displaymath" and "putMathLine".

Reimplemented in HTMLReporter, and LaTeXReporter.

Reporter & Reporter::beginItemize ( ) [virtual]
 

Start a block of itemized text. All "put" operations before using "endItemized" result in an item on the list.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::beginTable ( int ncols,
const String & col_format ) [virtual]
 

Start a new table with "ncols" columns. The second argument specifies the column formats (e.g. left, right, centered). If this argument is an empty string, a default format is used. All "put" operations before "endTable" is invoked will result in table lines. If one of the "put" functions for "ArrayGenSimple(real)" arguments is used, we may give explicit C++-style format strings (such as ""6.3f"") for each entry. The argument "cell_format" can be a single string containing the format for all entries of the table. Alternatively, it may be an array of size M x N, M x 1 or 1 x N when used with a numeric array of size M x N. In this way, we may specify individual formats for each entry, each row or each column. If the numeric array has less columns than indicated by the parameter "ncols" used in the previous call to "beginTable", all rows are padded with blank entries at the end. When using the simplest "put" function that takes only a "String" argument, the user have to hard-code eventual formatting instructions for a table line. In this case, the function "cellpad" may be handy in order to get all table entries lined up properly. The parameters "caption" and "label" in "endTable" are used to generate a table caption and adding a label for easy reference.

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::beginTabular ( int ncols,
const String & col_format ) [virtual]
 

As "beginTable" without caption and labelling. This environment is closed by "endTabular".

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

String Reporter::cellpad ( const String & s ) [pure virtual]
 

Utility for easy formatting of table cells, see "beginTable".

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::centerline ( const String & txt ) [pure virtual]
 

Print a centered line without extra spacing.

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

bool Reporter::copyFile ( const String & file,
const String & format ) [protected, virtual]
 

Reporter & Reporter::displaymath ( const String & txt )
 

Shorthand for a pair of "beginDispmath" and "endDispmath" calls.

Reporter & Reporter::drawline ( ) [pure virtual]
 

Just that, draw a line across the full pagewidth. However, when used within a table environment it is meant to be a line across the full table.

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::eject ( int n = 1 ) [pure virtual]
 

Produce n blank lines (that actually shows up in final printing).

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endCenter ( ) [virtual]
 

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endDispmath ( ) [virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endEnumerate ( ) [virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endFigure ( const String & caption,
const String & label ) [virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endGroup ( ) [virtual]
 

Reimplemented in HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endItemize ( ) [virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endTable ( const String & caption,
const String & label ) [virtual]
 

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::endTabular ( ) [virtual]
 

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::figure ( const Strings & psfilename,
const Strings & caption,
const String & common_caption,
const Strings & label,
real cmWidth = 10.0 ) [virtual]
 

See documentation of one of the overloaded functions.

Reimplemented in LaTeXReporter.

Reporter & Reporter::figure ( const String & psfilename,
const String & caption,
const String & label,
real cmWidth = 10.0 ) [virtual]
 

Shorthand for a pair of "beginFigure" and "endFigure" calls. There is an overloaded version that takes an array of PostScript filenames and corresponding captions. These figures are then placed within the same document figure if possible (in `\`LaTeX`\` this is straightforward, in HTML it will simply be a series of ordinary figures and in ASCII format there is no support for figures at all). The "common_caption" string is a leading text for the captions array, each array entry will be preceeded by an "(a)", "(b)" etc and separated by a semicolon.

Reimplemented in LaTeXReporter.

Reporter & Reporter::flush ( )
 

Flush the output buffer.

String Reporter::getCurrPlotDir ( )
 

Returns a string giving the directory where PostScript files used by the figure environment should be placed. This location depends on the filename used by the report and the section numbering.

String Reporter::getGroup ( const String & txt,
TextStyle style ) [virtual]
 

The received text is returned, wrapped as a group with text attributes set according to the parameter "style". See also "beginGroup".

Reimplemented in HTMLReporter, and LaTeXReporter.

String Reporter::getSectionRef ( ) [pure virtual]
 

Returns a "String" containing the current section reference.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::header ( const String & title,
const String & author,
bool fullpage = true,
bool singlefile = true,
const char * purpose = NULL ) [virtual]
 

Create titles for the first page. The arguments "fullpage" and "singlefile" decides whether a separate titlepage is generated and whether the present file will hold one or many reports. The "purpose" string leads to a comment in the header about the purpose of the report (if it is a "NULL" string, which is default, no such comment appears). Usually, "header" is the initial call to a function in a reporter. The function "trailer" provides its counterpart for use at the end of a report.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::insert ( const String & txt )
 

Insert text as is, i.e., without call to "adaptString". The function "insert" may be useful for embedding special typesetting instructions, such as `\`LaTeX`\` macros.

Reporter & Reporter::insertDocument ( const String & basename ) [pure virtual]
 

Insert a document in the report. The argument should reflect the basename of the document's name, without extensions such as ".ps" or ".tex". In ASCII reports, insertion of documents is impossible, `\`LaTeX`\` reports appends the extension ".tex" to the basename and includes that document, while HTML reports append ".ps" to the basename, assumes that it is a PostScript file and make a hyperlink to this file.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::insertVerbatim ( const String & file ) [pure virtual]
 

Insert a document as is (verbatim mode).

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::linebreak ( ) [pure virtual]
 

Start a new line.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

String Reporter::makeLabelRef ( const String & label ) [pure virtual]
 

Receives a string previously used as "label" argument in a figure or table environment. The function returns a valid label reference based on the cross-refererencing mechanisms of the underlying report format.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::pagebreak ( ) [pure virtual]
 

Start a new page.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

void Reporter::preparePlots ( ) [protected]
 

void Reporter::preview ( bool postscript = true ) [pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

void Reporter::print ( bool postscript = true ) [pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

void Reporter::process ( bool postscript = true ) [pure virtual]
 

These functions make calls to Unix commands that process, print or preview the current report. The actual commands are set at compile time (see "ReportSysCmd".h). These system defined commands may be overruled by setting certain environment variables (see documentation for each report class). The parameter "postscript" should be true if the report needs PostScript processing.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::put ( ArrayGenSimple(real) & tb,
ArrayGenSimple(String) & cell_format ) [virtual]
 

See documentation of one of the overloaded functions.

Reporter & Reporter::put ( ArrayGenSimple(real) & tb,
const String & cell_format ) [virtual]
 

See documentation of one of the overloaded functions.

Reporter & Reporter::put ( ArrayGenSimple(real) & tb ) [virtual]
 

See documentation of one of the overloaded functions.

Reporter & Reporter::put ( ArrayGenSimple(String) & tb ) [virtual]
 

See documentation of one of the overloaded functions.

Reporter & Reporter::put ( const String & txt )
 

This function allows the insertion of any text segment. Its action will differ depending on the current environment.

Overloaded versions permits the insertion of arrays with "String" or "real" entries into tables (see "beginTable").

void Reporter::putCenterline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

void Reporter::putDispmathline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

void Reporter::putEnumline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

void Reporter::putFigureline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

void Reporter::putItemline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::putLabel ( const String & label ) [inline, virtual]
 

Put a label in current position. For example, in `\`LaTeX`\` documents, this will be an ordinary label that can be referred to later using the ref command (coded in class "Reporter" by the function "putReference"), while in HTML documents a label will result in an anchor (similary, the hyperlink to an anchor is coded using the "putReference" function).

Reimplemented in HTMLReporter, and LaTeXReporter.

Reporter & Reporter::putReference ( const String & label,
const String & document ) [inline, virtual]
 

See documentation of one of the overloaded functions.

Reimplemented in HTMLReporter, and LaTeXReporter.

Reporter & Reporter::putReference ( const String & label ) [inline, virtual]
 

Makes a reference to a label. See documentation of the "puLabel" function. The function with only one argument is useful for `\`LaTeX`\` documents only. HTML documents usually require a document-label and a highlighted text. The overloaded version of "putReference" is aimed at both `\`LaTeX`\` and HTML reports. The "label" argument is the `\`LaTeX`\` label and the highlighted text in HTML while the "document" argument is the document-label in HTML.

Reimplemented in HTMLReporter, and LaTeXReporter.

void Reporter::putTableline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

void Reporter::putTabularline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTML2Reporter, HTMLReporter, and LaTeXReporter.

void Reporter::putTextline ( const String & txt ) [protected, pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::putmathline ( const String & txt ) [virtual]
 

Insert a text that is set in math mode (if available).

Reporter & Reporter::section ( const String & txt,
const String & label ) [virtual]
 

See documentation of one of the overloaded functions.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::section ( const String & txt ) [virtual]
 

Start a new section. An overloaded version of the function equips the section with a label. This enables easy reference to sections in LaTeX documents and hyperlinks in HTML documents. See also the "putLabel" function.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::subsection ( const String & txt,
const String & label ) [pure virtual]
 

See documentation of one of the overloaded functions.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::subsection ( const String & txt ) [pure virtual]
 

Start a new subsection (numbered within the current section). An overloaded version enables marking the subsection with a label, see the comments for the "section" function.

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::subsubsection ( const String & txt,
const String & label ) [pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::subsubsection ( const String & txt ) [pure virtual]
 

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.

Reporter & Reporter::trailer ( ) [virtual]
 

Close a report, see "header".

Reimplemented in ASCIIReporter, HTMLReporter, and LaTeXReporter.


Member Data Documentation

String Reporter::cell_delim [protected]
 

String Reporter::currPlotDir [protected]
 

ReporterEnvir Reporter::envir [protected]
 

Stack(ReporterEnvir) Reporter::envirStack [protected]
 

String Reporter::extension [protected]
 

String Reporter::filename [protected]
 

Os Reporter::os [protected]
 

int Reporter::plotSecCount [protected]
 

String Reporter::purpose [protected]
 

bool Reporter::singlefile [protected]
 

TextStyle Reporter::style [protected]
 

Stack(TextStyle) Reporter::styleStack [protected]
 

int Reporter::tb_ncols [protected]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.