SUMO - Simulation of Urban MObility
|
Abstract base class for output formatters. More...
#include <OutputFormatter.h>
Public Member Functions | |
virtual void | closeOpener (std::ostream &into)=0 |
Ends the most recently opened element start. | |
virtual bool | closeTag (std::ostream &into, bool abbreviated=false)=0 |
Closes the most recently opened tag. | |
virtual void | openTag (std::ostream &into, const std::string &xmlElement)=0 |
Opens an XML tag. | |
virtual void | openTag (std::ostream &into, const SumoXMLTag &xmlElement)=0 |
Opens an XML tag. | |
virtual void | writeAttr (std::ostream &into, const std::string &attr, const std::string &val)=0 |
writes an arbitrary attribute | |
virtual bool | writeXMLHeader (std::ostream &into, const std::string &rootElement, const std::string xmlParams="", const std::string &attrs="", const std::string &comment="")=0 |
Writes an XML header with optional configuration. | |
virtual | ~OutputFormatter () |
Destructor. |
Abstract base class for output formatters.
OutputFormatter format XML like output into the output stream. There are only two implementation at the moment, "normal" XML and binary XML.
Definition at line 58 of file OutputFormatter.h.
|
inlinevirtual |
Destructor.
Definition at line 61 of file OutputFormatter.h.
|
pure virtual |
Ends the most recently opened element start.
Writes more or less nothing but ">" and a line feed.
[in] | into | The output stream to use |
Implemented in BinaryFormatter, and PlainXMLFormatter.
Referenced by OutputDevice::closeOpener().
|
pure virtual |
Closes the most recently opened tag.
[in] | into | The output stream to use |
[in] | name | whether abbreviated closing is performed |
Implemented in BinaryFormatter, and PlainXMLFormatter.
Referenced by OutputDevice::closeTag().
|
pure virtual |
Opens an XML tag.
An indentation, depending on the current xml-element-stack size, is written followed by the given xml element ("<" + xmlElement) The xml element is added to the stack, then.
[in] | into | The output stream to use |
[in] | xmlElement | Name of element to open |
Implemented in BinaryFormatter, and PlainXMLFormatter.
Referenced by OutputDevice::openTag().
|
pure virtual |
Opens an XML tag.
Helper method which finds the correct string before calling openTag.
[in] | into | The output stream to use |
[in] | xmlElement | Id of the element to open |
Implemented in BinaryFormatter, and PlainXMLFormatter.
|
pure virtual |
writes an arbitrary attribute
[in] | into | The output stream to use |
[in] | attr | The attribute (name) |
[in] | val | The attribute value |
Implemented in BinaryFormatter, and PlainXMLFormatter.
Referenced by OutputDevice::writeAttr().
|
pure virtual |
Writes an XML header with optional configuration.
If something has been written (myXMLStack is not empty), nothing is written and false returned.
[in] | into | The output stream to use |
[in] | rootElement | The root element to use |
[in] | xmlParams | Additional parameters (such as encoding) to include in the <?xml> declaration |
[in] | attrs | Additional attributes to save within the rootElement |
[in] | comment | Additional comment (saved in front the rootElement) |
Check which parameter is used herein
Describe what is saved
Implemented in BinaryFormatter, and PlainXMLFormatter.
Referenced by OutputDevice::writeXMLHeader().