OMNeT++ NEDXML  6.0.3
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 = true
 
int indentSize = 2
 

Constructor & Destructor Documentation

◆ XMLGenerator()

XMLGenerator ( )
inline

Constructor

◆ ~XMLGenerator()

virtual ~XMLGenerator ( )
inlinevirtual

Destructor

Member Function Documentation

◆ printAttrValue()

virtual void printAttrValue ( std::ostream &  out,
const char *  s 
)
protectedvirtual

◆ doGenerate()

virtual void doGenerate ( std::ostream &  out,
ASTNode node,
int  level 
)
protectedvirtual

◆ setSourceLocationAttributes()

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.

◆ setIndentSize()

virtual void setIndentSize ( int  indentsize)
virtual

Set indent size in the output XML.

◆ generate() [1/2]

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.

◆ generate() [2/2]

virtual std::string generate ( ASTNode tree)
virtual

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

Member Data Documentation

◆ printSrcLoc

bool printSrcLoc = true
protected

◆ indentSize

int indentSize = 2
protected

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