MIRA
Classes | Public Types | Public Member Functions | List of all members
ConfigurationLoader Class Reference

Class for loading, parsing, modifying and interpreting application configuration files. More...

#include <loader/Loader.h>

Public Types

typedef std::map< std::string, std::string > Context
 

Public Member Functions

 ConfigurationLoader (bool unknownTagWarning=true)
 The constructor. More...
 
void registerPreparePlugin (ConfigurationPreparePluginPtr plugin)
 Register a prepare plugin. More...
 
void registerLoaderPlugin (const ClassProxy &plugin)
 Register a loader plugin. More...
 
void prepare (XMLDom &ioXML)
 Prepare the document. More...
 
void load (const XMLDom &xml)
 Load/interpret the document. More...
 
ContextgetContext ()
 Get the context of the loader. More...
 

Detailed Description

Class for loading, parsing, modifying and interpreting application configuration files.

Member Typedef Documentation

◆ Context

typedef std::map<std::string, std::string> Context

Constructor & Destructor Documentation

◆ ConfigurationLoader()

ConfigurationLoader ( bool  unknownTagWarning = true)

The constructor.

Parameters
[in]unknownTagWarningFlag controlling if warning messages are shown when encountering unknown tags.

Member Function Documentation

◆ registerPreparePlugin()

void registerPreparePlugin ( ConfigurationPreparePluginPtr  plugin)

Register a prepare plugin.

They get inserted in a list of prepare plugins that is sorted ascending by the order returned by the call to ConfigurationPreparePlugin::getOrder() (smallest order first).

Parameters
[in]pluginThe plugin

◆ registerLoaderPlugin()

void registerLoaderPlugin ( const ClassProxy plugin)

Register a loader plugin.

These plugins are called whenever their supported tag is found.

Parameters
[in]pluginThe plugin class description

◆ prepare()

void prepare ( XMLDom ioXML)

Prepare the document.

Prepare plugins are called in the order they appear in the sorted list that is sorted ascending by the order number of each preparer (smallest order first).

Parameters
[in,out]ioXMLThe xml document

◆ load()

void load ( const XMLDom xml)

Load/interpret the document.

All loader plugins are called whenever their supported tag is found.

Parameters
[in]xmlThe xml document

◆ getContext()

Context& getContext ( )
inline

Get the context of the loader.

The context can be used to store the current state of a plugin. This state can be used by other plugins. e.g. the NamespaceLoader stores the current namespace context, that can be used by the UnitLoader.


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