SPABuilder.Config Class Reference

Detailed Description

Reads configuration settings from a set of files.

Public Member Functions

 Config ()
 Creates new empty configuration. More...
 
 Config (OnLog logMethod)
 Creates new configuration with the given log method. More...
 
ConfigReader AddFile (string path)
 Adds the given file to the reader set if the file exists. More...
 
string Get (string property)
 Gets the config setting for the given property. More...
 
bool GetBoolean (string property)
 Gets the named property as a true/false value. A property that doesn't exist will always be false. More...
 
bool GetBoolean (string property, bool ifNotFound)
 Gets the named property as a true/false value. A property that doesn't exist will be the defined value. More...
 

Public Attributes

OnLog LogMethod
 A method to call when a message is logged (but not to a file). More...
 
List< ConfigReaderAllReaders
 All config readers in order of preference. The first one in the list is overridden by the ones following it. More...
 

Constructor & Destructor Documentation

SPABuilder.Config.Config ( )
inline

Creates new empty configuration.

SPABuilder.Config.Config ( OnLog  logMethod)
inline

Creates new configuration with the given log method.

Parameters
logMethodThe method to call when a message is logged (but not to a file).

Member Function Documentation

ConfigReader SPABuilder.Config.AddFile ( string  path)
inline

Adds the given file to the reader set if the file exists.

Parameters
pathThe path to the file to add.
Returns
The ConfigReader for the given config file if it was found; null otherwise.
string SPABuilder.Config.Get ( string  property)
inline

Gets the config setting for the given property.

Parameters
propertyThe property to get the value of.
Returns
The property value if found. Null otherwise.
bool SPABuilder.Config.GetBoolean ( string  property)
inline

Gets the named property as a true/false value. A property that doesn't exist will always be false.

Parameters
propertyThe property to get the value for.
Returns
True if the value is e.g. yes/true/yep etc.
bool SPABuilder.Config.GetBoolean ( string  property,
bool  ifNotFound 
)
inline

Gets the named property as a true/false value. A property that doesn't exist will be the defined value.

Parameters
propertyThe property to get the value for.
ifNotFoundThe value the result should be if the named property is not found.
Returns
True if the value is e.g. yes/true/yep etc.

Member Data Documentation

List<ConfigReader> SPABuilder.Config.AllReaders

All config readers in order of preference. The first one in the list is overridden by the ones following it.

OnLog SPABuilder.Config.LogMethod

A method to call when a message is logged (but not to a file).