OMNeT++ NEDXML  5.4.1
XMLGenerator Class Reference

#include <xmlgenerator.h>

Description

Serializes an AST in XML format.

Public Member Functions

 XMLGenerator ()
 
virtual ~XMLGenerator ()
 
virtual void setSourceLocationAttributes (bool srcloc)
 
virtual void setIndentSize (int indentsize)
 
virtual void generate (std::ostream &out, ASTNode *tree)
 
virtual std::string generate (ASTNode *tree)
 

Protected Member Functions

virtual void printAttrValue (std::ostream &out, const char *s)
 
virtual void doGenerate (std::ostream &out, ASTNode *node, int level)
 

Protected Attributes

bool printSrcLoc
 
int indentSize
 

Constructor & Destructor Documentation

Constructor

virtual ~XMLGenerator ( )
virtual

Destructor

Member Function Documentation

virtual void printAttrValue ( std::ostream &  out,
const char *  s 
)
protectedvirtual
virtual void doGenerate ( std::ostream &  out,
ASTNode node,
int  level 
)
protectedvirtual
virtual void 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 ASTNode tree was produced by parsing a NED file, src-loc attributes refer to locations in the NED file.

virtual void setIndentSize ( int  indentsize)
virtual

Set indent size in the output XML.

virtual void generate ( std::ostream &  out,
ASTNode 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 std::string generate ( ASTNode tree)
virtual

Serialize the object tree into XML, and return the result as string.

Member Data Documentation

bool printSrcLoc
protected
int indentSize
protected

The documentation for this class was generated from the following file: