LatNet Builder Manual 2.1.3-6
Software Package for Constructing Highly Uniform Point Sets
|
This class is a simple implementation of the Writer abstract class to write in plain text format on the stream. More...
#include <WriterRes.h>
Inherits LatticeTester::Writer< Int >.
Public Member Functions | |
WriterRes (const char *fileName) | |
Constructor that opens the writer to write at the beginning of file fileName. | |
WriterRes (std::ostream *stream) | |
Constructor that will use stream as an output stream. | |
void | beginTabbedSection () |
Implementation of the method defined in Writer. | |
void | endTabbedSection () |
Implementation of the method defined in Writer. | |
void | addTab () |
Implementation of the method defined in Writer. | |
void | removeTab () |
Implementation of the method defined in Writer. | |
void | clearTab () |
Implementation of the method defined in Writer. | |
void | defaultTab () |
Implementation of the method defined in Writer. | |
void | newLine () |
Implementation of the method defined in Writer. | |
void | newParagraph () |
Implementation of the method defined in Writer. | |
void | writeMathString (const std::string) |
Implementation of the method defined in Writer. | |
void | writeStandOutMathString (const std::string) |
Implementation of the method defined in Writer. | |
Public Member Functions inherited from LatticeTester::Writer< Int > | |
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 | writeBool (const bool &value) |
Writes a bool on the stream. | |
virtual void | writeInt (const int &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 std::ostream & | getStream () |
Returns the stream on which this object writes. |
Protected Attributes | |
bool | m_isTabbed = false |
Indicates if we currently are in a tabbed section. | |
std::string | m_prefix |
Used to remember the state of the tabs and white spaces needed to align correctly a line, for instance when in a tabbed section. | |
Protected Attributes inherited from LatticeTester::Writer< Int > | |
std::ostream * | m_stream |
The stream in which the writings are done. |
This class is a simple implementation of the Writer abstract class to write in plain text format on the stream.
This class defines no other method than the interface and can be viewed as an example to what the Writer interface is intended to be.
LatticeTester::WriterRes< Int >::WriterRes | ( | std::ostream * | stream | ) |
Constructor that will use stream as an output stream.
This will make the writer start writing at the end of the stream.
References LatticeTester::Writer< Int >::Writer().
|
virtual |
Implementation of the method defined in Writer.
This adds 2 spaces to the prefix of tabbed sections.
Implements LatticeTester::Writer< Int >.
References m_isTabbed, and m_prefix.
|
virtual |
Implementation of the method defined in Writer.
In this class, by default, a tabbed section has 2 spaces at the beginning of lines. Calling this methods resets the prefix of tabbed sections to the default.
Implements LatticeTester::Writer< Int >.
References m_isTabbed, and m_prefix.
Referenced by writeStandOutMathString().
|
virtual |
Implementation of the method defined in Writer.
This sets the prefix of tabbed sections to an empty string.
Implements LatticeTester::Writer< Int >.
References m_isTabbed, and m_prefix.
|
virtual |
Implementation of the method defined in Writer.
This sets the prefix of tabbed sections to a string with 2 spaces.
Implements LatticeTester::Writer< Int >.
References m_isTabbed, and m_prefix.
|
virtual |
Implementation of the method defined in Writer.
Implements LatticeTester::Writer< Int >.
References m_isTabbed, and m_prefix.
Referenced by newParagraph(), and writeStandOutMathString().
|
virtual |
Implementation of the method defined in Writer.
Prints a newline character and the prefix of a tabbed section if a the writer is in a tabbed section.
Implements LatticeTester::Writer< Int >.
References m_isTabbed, m_prefix, and LatticeTester::Writer< Int >::m_stream.
Referenced by newParagraph(), and writeStandOutMathString().
|
virtual |
Implementation of the method defined in Writer.
Prints 2 newline characters and ends the tabbed section if the program is in a tabbed section.
Implements LatticeTester::Writer< Int >.
References endTabbedSection(), and newLine().
|
virtual |
Implementation of the method defined in Writer.
This removes 2 spaces to the prefix of tabbed sections.
Implements LatticeTester::Writer< Int >.
References m_isTabbed, and m_prefix.
|
virtual |
Implementation of the method defined in Writer.
This writes the string passed as an argument to the output string.
Implements LatticeTester::Writer< Int >.
References LatticeTester::Writer< Int >::m_stream.
|
virtual |
Implementation of the method defined in Writer.
This writes the string passed as argument in a tabbed section with a newline character before and after.
Implements LatticeTester::Writer< Int >.
References beginTabbedSection(), endTabbedSection(), LatticeTester::Writer< Int >::m_stream, and newLine().
|
protected |
Indicates if we currently are in a tabbed section.
The methods of this class will print m_prefix at each newline if m_isTabbed is true.
Referenced by addTab(), beginTabbedSection(), clearTab(), defaultTab(), endTabbedSection(), newLine(), and removeTab().