Lattice Tester Online Documentation 0.1.0-861
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
|
This is an abstract class that represents an interface to Writer
classes.
More...
#include <latticetester/Writer.h>
Public Member Functions | |
Writer (const char *fileName) | |
Constructor that opens a Writer to write in the file filename . | |
Writer (std::ostream *stream) | |
Constructor that opens a Writer to write directly in an ostream . | |
virtual | ~Writer () |
Destructor. | |
virtual void | beginTabbedSection ()=0 |
Begins a tabbed section. | |
virtual void | endTabbedSection ()=0 |
Ends a tabbed section. | |
virtual void | addTab ()=0 |
After this is called, newlines in tabbed sections will have an additional tab. | |
virtual void | removeTab ()=0 |
After this is called, newlines in tabbed sections will have one less tab. | |
virtual void | clearTab ()=0 |
After this is called, newlines in tabbed sections will have no tab. | |
virtual void | defaultTab ()=0 |
After this is called, newlines in tabbed sections will use the default amount of tabs and spaces of the class. | |
virtual void | newLine ()=0 |
Starts a new line and adds the right amount of tabs if in a tabbed section. | |
virtual void | newParagraph ()=0 |
Starts a new paragraph. | |
virtual void | writeBool (const bool &value) |
Writes a bool on the stream. | |
virtual void | writeInt (const int64_t &value) |
Writes an int on the stream. | |
virtual void | writeString (const std::string &value) |
Writes a string on the stream. | |
virtual void | writeDouble (const double &value) |
Writes a double on the stream. | |
virtual void | writeIntScal (const Int &value) |
Writes a IntScal on the stream. | |
virtual void | writeMMat (const IntMat &A) |
Writes a IntMat on the stream. | |
virtual void | writeMathString (const std::string)=0 |
Writes a string that is formated and in LaTeX math mode. | |
virtual void | writeStandOutMathString (const std::string)=0 |
Writes a string that is formated and in LaTeX math mode with a newline after and before the string. | |
virtual std::ostream & | getStream () |
Returns the stream on which this object writes. | |
Protected Attributes | |
std::ostream * | m_stream |
The stream in which the writings are done. | |
This is an abstract class that represents an interface to Writer
classes.
That is, this class methods are intended to be used as a way to format an output on an ostream
or a file. It already implements functions to write basic data types. A subclass of this class must be implemented if you want to use it. WriterRes
offers utilities to print in a file or on the command line. Since this class must be overridden, it is possible to implement subclasses to format text for different kind of output such as plain text, \(\LaTeX\) or HTML.
If this class is used on a file, it will automatically print at the start of the file and overwrite it. But if a stream is passed to this object, it will not be modified. That means that it is possible to write on a single stream with multiple writers.
LatticeTester::Writer< Int >::Writer | ( | const char * | fileName | ) |
Constructor that opens a Writer
to write in the file filename
.
This will overwrite the file and start printing at the start. The program will make/ovewrite a file in the working directory from which the program was called.
LatticeTester::Writer< Int >::Writer | ( | std::ostream * | stream | ) |
Constructor that opens a Writer
to write directly in an ostream
.
This will not change the stream
object. That means that it is possible to create a stream and pass it to different implementations of this interface via this constructor to use different printing formats.
|
virtual |
Destructor.
|
pure virtual |
After this is called, newlines in tabbed sections will have an additional tab.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
pure virtual |
Begins a tabbed section.
In a tabbed section, every newline character is followed by a series of whitespace or tab characters such that the first non-blank characters of the lines in this section are aligned. The amount of tabs in the begginning of the section can be modified with the addTab()
, removeTab()
and clearTab()
methods.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
pure virtual |
After this is called, newlines in tabbed sections will have no tab.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
pure virtual |
After this is called, newlines in tabbed sections will use the default amount of tabs and spaces of the class.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
pure virtual |
Ends a tabbed section.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
inlinevirtual |
Returns the stream on which this object writes.
If the stream is a simple ostream
, this can be used to then print on standard output for example. If this is a file. It can be possible to used different writers in succession.
|
pure virtual |
Starts a new line and adds the right amount of tabs if in a tabbed section.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
pure virtual |
Starts a new paragraph.
Automatically ends the tabbed section if the writer was in one.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
pure virtual |
After this is called, newlines in tabbed sections will have one less tab.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
virtual |
Writes a bool
on the stream.
|
virtual |
Writes a double
on the stream.
|
virtual |
Writes an int
on the stream.
|
virtual |
Writes a IntScal
on the stream.
|
pure virtual |
Writes a string
that is formated and in LaTeX math mode.
This can be used to print mathemetical formulas in a standardised format.
This method can be implemented in various way. For example, it is possible to have it print with or without the LaTeX $ signs.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
virtual |
Writes a IntMat
on the stream.
|
pure virtual |
Writes a string
that is formated and in LaTeX math mode with a newline after and before the string.
This can be used to print mathemetical formulas in a standardised format.
This method can be implemented in various way. For example, it is possible to have it print with or without the LaTeX \equation delimiters.
This is a pure virtual method that has no implementation.
Implemented in LatticeTester::WriterRes< Int >.
|
virtual |
Writes a string
on the stream.
|
protected |
The stream in which the writings are done.