Deepsolver
Public Member Functions
Deepsolver::AbstractConfigFileHandler Class Reference

The interface to listen parsed configuration file parameters. More...

Inheritance diagram for Deepsolver::AbstractConfigFileHandler:
Deepsolver::ConfigCenter

List of all members.

Public Member Functions

virtual void onConfigFileValue (const StringVector &path, const std::string &sectArg, const std::string &value, bool adding, const ConfigFilePosInfo &pos)=0
 The event about newly parsed configuration file parameter.
virtual ~AbstractConfigFileHandler ()
 The destructor.

Detailed Description

This abstract class describes the interface to get every parsed configuration line parameter. It is generally purposed for various configuration file handlers. It does not take care about any configuration semantics.

The events are sent only for every parameter but not for section headers. It is enough for current requirements but in future the section events must present as well as parameter events now. In additional parameter events must be slightly extended to provide complete information necessary for constructing text form of configuration file back. It makes possible creation of various configuration data editing utilities.

See also:
ConfigFile ConfigFilePosInfo

Member Function Documentation

void ConfigCenter::onConfigFileValue ( const StringVector &  path,
const std::string &  sectArg,
const std::string &  value,
bool  adding,
const ConfigFilePosInfo pos 
) [pure virtual]

This method transmits information about one parsed configuration line parameter with complete information for its proper processing The information includes parameter path, first section argument if it has any boolean flag to indicate is it new assignment or adding to already existing value, the parameter value and information about parameter position in file.

The parameter name consists of several components called parameter path. The last path component is the exact parameter name and it is always present, all previous components are the section names and can be mentioned in file either in section header or in the line of parameter. In both cases name components are delimited by dots. If section argument is not empty it is always associated with first component in parameter path.

Parameters:
[in]pathThe parameter path including its exact name
[in]sectArgThe argument for the first path component if it has any
[in]valueThe parameter value
[in]*adding The flag for indication not to erase previously set value if was any and perform adding
[in]posThe information about the line position in the configuration file