Serializes a NED object tree in XML format. More...
#include <xmlgenerator.h>
Public Member Functions | |
| NEDXMLGenerator () | |
| virtual | ~NEDXMLGenerator () |
| virtual void | setSourceLocationAttributes (bool srcloc) |
| virtual void | setIndentSize (int indentsize) |
| virtual void | generate (std::ostream &out, NEDElement *tree) |
| virtual std::string | generate (NEDElement *tree) |
Protected Member Functions | |
| virtual void | printAttrValue (std::ostream &out, const char *s) |
| virtual void | doGenerate (std::ostream &out, NEDElement *node, int level) |
Protected Attributes | |
| bool | printsrcloc |
| int | indentsize |
Serializes a NED object tree in XML format.
| NEDXMLGenerator::NEDXMLGenerator | ( | ) |
Constructor.
| virtual NEDXMLGenerator::~NEDXMLGenerator | ( | ) | [virtual] |
Destructor.
| virtual void NEDXMLGenerator::doGenerate | ( | std::ostream & | out, | |
| NEDElement * | node, | |||
| int | level | |||
| ) | [protected, virtual] |
| virtual std::string NEDXMLGenerator::generate | ( | NEDElement * | tree | ) | [virtual] |
Serialize the object tree into XML, and return the result as string.
| virtual void NEDXMLGenerator::generate | ( | std::ostream & | out, | |
| NEDElement * | tree | |||
| ) | [virtual] |
Serialize the object tree as XML to the given output stream.
The XML declaration will be:
<?xml version="1.0"?>
I.e. unspecified encoding, and no document type will be included.
| virtual void NEDXMLGenerator::printAttrValue | ( | std::ostream & | out, | |
| const char * | s | |||
| ) | [protected, virtual] |
| virtual void NEDXMLGenerator::setIndentSize | ( | int | indentsize | ) | [virtual] |
Set indent size in the output XML.
| virtual void NEDXMLGenerator::setSourceLocationAttributes | ( | bool | srcloc | ) | [virtual] |
Enable or disable generation of src-loc attributes in the output XML.
src-loc attributes contain filename-line-column information that refers to the original document. For example, if the NEDElement tree was produced by parsing a NED file, src-loc attributes refer to locations in the NED file.
int NEDXMLGenerator::indentsize [protected] |
bool NEDXMLGenerator::printsrcloc [protected] |
1.6.3