MIRA
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
XMLDomPreprocessor Class Reference

Preprocesses XML documents and resolves all special tags like , <if>, <warning> and so on. More...

#include <xml/XMLDomPreprocessor.h>

Public Types

typedef boost::function< std::string(const std::string &)> Callback
 
typedef std::list< PathIncludePathStack
 

Public Member Functions

 XMLDomPreprocessor ()
 
 XMLDomPreprocessor (const XMLVariablesMap &iVariables)
 
void preprocessXML (XMLDom &ioXml)
 
void registerXMLVariableCallback (const std::string &pattern, Callback &&callback)
 

Public Attributes

XMLVariablesMap variables
 

Protected Member Functions

std::string resolveXMLVariables (const std::string &pattern, const std::string &var)
 
std::string resolveContent (std::string content)
 
void preprocessAllLowLevel (XMLDom::iterator &iNode, IncludePathStack &ioPathStack)
 
void preprocessAll (XMLDom::iterator &iNode, IncludePathStack &ioPathStack)
 
void processSpecialVariables (XMLDom::iterator &node)
 
bool parseCondition (XMLDom::iterator &node)
 
bool parseConditionsRequireAll (XMLDom::iterator &node)
 
bool parseConditionsRequireAny (XMLDom::iterator &node)
 
bool parseExists (XMLDom::iterator &node)
 
bool parseExistsRequireAll (XMLDom::iterator &node)
 
bool parseExistsRequireAny (XMLDom::iterator &node)
 
XMLDom::iterator parseInclude (XMLDom::iterator &ioNode, IncludePathStack &ioPathStack)
 

Protected Attributes

std::map< std::string, CallbackmCallbacks
 
bool mAddedInfoToException
 

Detailed Description

Preprocesses XML documents and resolves all special tags like , <if>, <warning> and so on.

It also parses variable declarations via the tag. See help about XML config files. The member variables contains a key value variables map that will be altered if an <define> or tag is found and the variable name is not already in the map. It also processes special xml variables like find, findpkg or env. Additionally the user can add callbacks for user defined patterns that are called whenever the pattern is found anywhere in the document.

Member Typedef Documentation

◆ Callback

typedef boost::function<std::string (const std::string&)> Callback

◆ IncludePathStack

typedef std::list<Path> IncludePathStack

Constructor & Destructor Documentation

◆ XMLDomPreprocessor() [1/2]

XMLDomPreprocessor ( )
inline

◆ XMLDomPreprocessor() [2/2]

XMLDomPreprocessor ( const XMLVariablesMap iVariables)
inline

Member Function Documentation

◆ preprocessXML()

void preprocessXML ( XMLDom ioXml)

◆ registerXMLVariableCallback()

void registerXMLVariableCallback ( const std::string &  pattern,
Callback &&  callback 
)

◆ resolveXMLVariables()

std::string resolveXMLVariables ( const std::string &  pattern,
const std::string &  var 
)
protected

◆ resolveContent()

std::string resolveContent ( std::string  content)
protected

◆ preprocessAllLowLevel()

void preprocessAllLowLevel ( XMLDom::iterator iNode,
IncludePathStack ioPathStack 
)
protected

◆ preprocessAll()

void preprocessAll ( XMLDom::iterator iNode,
IncludePathStack ioPathStack 
)
protected

◆ processSpecialVariables()

void processSpecialVariables ( XMLDom::iterator node)
protected

◆ parseCondition()

bool parseCondition ( XMLDom::iterator node)
protected

◆ parseConditionsRequireAll()

bool parseConditionsRequireAll ( XMLDom::iterator node)
protected

◆ parseConditionsRequireAny()

bool parseConditionsRequireAny ( XMLDom::iterator node)
protected

◆ parseExists()

bool parseExists ( XMLDom::iterator node)
protected

◆ parseExistsRequireAll()

bool parseExistsRequireAll ( XMLDom::iterator node)
protected

◆ parseExistsRequireAny()

bool parseExistsRequireAny ( XMLDom::iterator node)
protected

◆ parseInclude()

XMLDom::iterator parseInclude ( XMLDom::iterator ioNode,
IncludePathStack ioPathStack 
)
protected

Member Data Documentation

◆ variables

XMLVariablesMap variables

◆ mCallbacks

std::map<std::string, Callback> mCallbacks
protected

◆ mAddedInfoToException

bool mAddedInfoToException
protected

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