#include <CeylanXMLVisitor.h>
Public Types | |
typedef std::string | ClosingMarkup |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
XMLSavingVisitor (System::OutputStream &output) | |
Creates a XML visitor dedicated to the saving of a XML tree. | |
virtual | ~XMLSavingVisitor () throw () |
Virtual destructor. | |
virtual Height | getHeight () const |
Returns current height. | |
virtual void | incrementHeight () |
Increments current height. | |
virtual void | decrementHeight () |
Decrements current height. | |
virtual void | visit (XMLMarkup &xmlMarkup) |
Visits specified XML markup and saves it to the internal output stream. | |
virtual void | visit (XMLText &xmlText) |
Visits specified XML text and saves it to the internal output stream. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns a user-friendly description of the state of this object. | |
Static Public Member Functions | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Static Public Attributes | |
static std::string | OffsetForMarkup = "\t" |
The offset for serialized XLM elements. | |
Protected Attributes | |
System::OutputStream * | _output |
The OutputStream where XML trees will be written. | |
std::stack< ClosingMarkup > | _markupsToClose |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
XMLSavingVisitor (const XMLSavingVisitor &source) | |
Copy constructor made private to ensure that it will never be called. | |
XMLSavingVisitor & | operator= (const XMLSavingVisitor &source) |
Assignment operator made private to ensure that it will never be called. |
Its role is to visit a XML tree and saves its nodes in order so that a well-formed XML document is serialized, included a starting XML header.
Definition at line 222 of file CeylanXMLVisitor.h.
typedef std::string Ceylan::XML::XMLSavingVisitor::ClosingMarkup |
Definition at line 317 of file CeylanXMLVisitor.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
XMLSavingVisitor::XMLSavingVisitor | ( | System::OutputStream & | output | ) |
Creates a XML visitor dedicated to the saving of a XML tree.
output | the output stream that should be used to save the XML tree. This visitor does not take ownership of this stream, it will not close nor delete it when itself destroyed. |
Definition at line 101 of file CeylanXMLVisitor.cc.
XMLSavingVisitor::~XMLSavingVisitor | ( | ) | throw () [virtual] |
Ceylan::XML::XMLSavingVisitor::XMLSavingVisitor | ( | const XMLSavingVisitor & | source | ) | [private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
void XMLSavingVisitor::decrementHeight | ( | ) | [virtual] |
Decrements current height.
Reimplemented from Ceylan::TreeHeightAwareVisitor< XMLElement >.
Definition at line 142 of file CeylanXMLVisitor.cc.
References _markupsToClose, _output, Ceylan::XML::EndOfLine, getHeight(), OffsetForMarkup, and Ceylan::System::OutputStream::write().
Ceylan::Height XMLSavingVisitor::getHeight | ( | ) | const [virtual] |
Returns current height.
Reimplemented from Ceylan::TreeHeightAwareVisitor< XMLElement >.
Definition at line 133 of file CeylanXMLVisitor.cc.
References _markupsToClose.
Referenced by decrementHeight(), and visit().
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
void XMLSavingVisitor::incrementHeight | ( | ) | [virtual] |
Increments current height.
Reimplemented from Ceylan::TreeHeightAwareVisitor< XMLElement >.
Definition at line 118 of file CeylanXMLVisitor.cc.
XMLSavingVisitor& Ceylan::XML::XMLSavingVisitor::operator= | ( | const XMLSavingVisitor & | source | ) | [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string XMLSavingVisitor::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Reimplemented from Ceylan::XML::XMLVisitor.
Definition at line 212 of file CeylanXMLVisitor.cc.
References _markupsToClose, _output, Ceylan::low, and Ceylan::System::OutputStream::toString().
void XMLSavingVisitor::visit | ( | XMLText & | xmlText | ) | [virtual] |
Visits specified XML text and saves it to the internal output stream.
xmlText | the XML text to save. |
VisitException | if this saving failed. |
Implements Ceylan::XML::XMLVisitor.
Definition at line 188 of file CeylanXMLVisitor.cc.
References _markupsToClose, _output, Ceylan::XML::EndOfLine, getHeight(), OffsetForMarkup, Ceylan::XML::XMLText::saveTo(), Ceylan::System::OutputStream::write(), and Ceylan::System::OutputStream::writeUint8().
void XMLSavingVisitor::visit | ( | XMLMarkup & | xmlMarkup | ) | [virtual] |
Visits specified XML markup and saves it to the internal output stream.
xmlMarkup | the XML markup to save. |
VisitException | if this saving failed. |
Implements Ceylan::XML::XMLVisitor.
Definition at line 164 of file CeylanXMLVisitor.cc.
References _markupsToClose, _output, Ceylan::XML::EndOfLine, Ceylan::XML::XMLMarkup::getClosingMarkup(), getHeight(), OffsetForMarkup, Ceylan::XML::XMLMarkup::saveTo(), Ceylan::System::OutputStream::write(), and Ceylan::System::OutputStream::writeUint8().
std::stack<ClosingMarkup> Ceylan::XML::XMLSavingVisitor::_markupsToClose [protected] |
Definition at line 338 of file CeylanXMLVisitor.h.
Referenced by decrementHeight(), getHeight(), toString(), and visit().
The OutputStream where XML trees will be written.
Definition at line 326 of file CeylanXMLVisitor.h.
Referenced by decrementHeight(), toString(), and visit().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
string XMLSavingVisitor::OffsetForMarkup = "\t" [static] |
The offset for serialized XLM elements.
Definition at line 314 of file CeylanXMLVisitor.h.
Referenced by decrementHeight(), and visit().