Index

NAME

ASCIIReporter - a report manager based on plain ASCII files


INCLUDE

include "Reporter.h"

SYNTAX

 class ASCIIReporter : public Reporter
 {
 private:

   int enumcnt;
   int seccnt;
   int subcnt;
   int subsubcnt;

   int itempad;

   int  cell_width;  // Table parameter;

   void makeHeaderNote ();
   void makeHeaderPage ();

 protected:

   virtual void putTextline     (const String& txt);
   virtual void putTabularline  (const String& txt);
   virtual void putTableline    (const String& txt);
   virtual void putItemline     (const String& txt);
   virtual void putEnumline     (const String& txt);
   virtual void putFigureline   (const String& txt);
   virtual void putDispmathline (const String& txt);
   virtual void putCenterline   (const String& txt);

   void fill  (const char c = ' ', const int n = 1);
   void space (const int n = 1);

 public:

   ASCIIReporter (Os os);
   ASCIIReporter (const String& filename);

   virtual ~ASCIIReporter () {}


       // Sectioning and other utilities

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

   virtual Reporter& section        (const String& txt);
   virtual Reporter& section        (const String& txt, const String& label)
                                    { return Reporter::section(txt,label); }
   virtual Reporter& subsection     (const String& txt);
   virtual Reporter& subsection     (const String& txt, const String& label);
   virtual Reporter& subsubsection  (const String& txt);
   virtual Reporter& subsubsection  (const String& txt, const String& label);

   virtual Reporter& pagebreak   ();
   virtual Reporter& linebreak   ();
   virtual Reporter& eject       (int n = 1);
   virtual Reporter& drawline    ();


       // For easy formatting of table cells

   virtual String cellpad (const String& s);


       // Put text string into report

   virtual Reporter& centerline  (const String& txt);

   virtual Reporter& insertDocument (const String& basename);
   virtual Reporter& insertVerbatim (const String& file);

       // Environments

   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);


       // Post-processing and presentation of report

   virtual void process (bool postscript = true);
   virtual void print   (bool postscript = true);
   virtual void preview (bool postscript = true);


   CLASS_INFO

 };



KEYWORDS

ASCII, report, output, table



DESCRIPTION

This  class  offers  an  interface  to report generation in plain
ASCII  format,  suitable  for  printing  by  mpage   or   similar
formatting utilities.



CONSTRUCTORS AND INITIALIZATION

See Reporter.



MEMBER FUNCTIONS

See Reporter.

However, there are some additional comments to be made:



beginTable - Table entries are forced to be left justified, i.e.,
the argument col_format is neglected. In order to get  the  table
entries  lined  up  properly, the user is encouraged to apply the
put functions that operate on array structures. If it is  prefer­
able  to use the simple String-based put, the function cellpad is
usually needed to obtain a satisfactory result. This  is  clearly
illustrated  when  running  the example program from the Reporter
documentation in ASCII mode.

figure - There is no support for PostScript figures.

process, print, preview - System defaults may be overruled by the
environment variables

 ASCIIRep_CLEANUP_CMD,
 ASCIIRep_PROCESS_TXT_CMD,
 ASCIIRep_PROCESS_PS_CMD,
 ASCIIRep_PRINT_TXT_CMD,
 ASCIIRep_PRINT_PS_CMD,
 ASCIIRep_PREVIEW_TXT_CMD,
 ASCIIRep_PREVIEW_PS_CMD,

see the file ReporterSysCmd.h for examples.






EXAMPLES

See Reporter and run the code with repformat = ASCIIReporter.




SEE ALSO

class Reporter, class LaTeXReporter, class Os, class ArrayGenSim­
ple


AUTHOR

Are Magnus Bruaset, SINTEF Applied Mathematics A few additions by
Hans Petter Langtangen, SINTEF Applied Mathematics and University
of Oslo.