Abstract class that represents a plug in for class Configuration to provide configuration data from specific configuration data source.
See documentation of namespace cs.aworx.lib.config for more information on ALib external configuration variables.
The plug-in also may have the ability to write data. The default implementation for writing configuration data returns constant false, indicating that this plug-in never writes anything (e.g. command line parameter plug-in, environment variable plug-in).
Category and Variable names are character case insensitive for the plug-ins predefined with ALib. It is recommended to to ignore character case in custom specializations of this class as well.
Public Fields | |
XTernalizer | StringConverter |
Public Methods | |
abstract bool | Load (Variable variable, bool searchOnly=false) |
virtual bool | Store (Variable variable) |
virtual bool | Store (Variable variable, Object externalizedValue) |
Protected Fields | |
XTernalizer | defaultStringConverter = new XTernalizer() |
Protected Methods | |
ConfigurationPlugin () | |
|
inlineprotected |
Constructor which is protected, as this is an abstract class.
|
pure virtual |
Abstract method that has to be overwritten by descendants. Searches and by default retrieves the value of a configuration variable. If searchOnly is true
, then the variable value is not read.
variable | The variable to retrieve. |
searchOnly | If true , the variable must not be read. Defaults to false . |
true
if variable was found within this configuration source, false
if not. Implemented in Environment, CLIArgs, and InMemoryPlugin.
|
inlinevirtual |
Writes a variable to the configuration. This default implementation just returns false
. If this method is not overwritten in descendants, those descendants are not designed to write data.
variable | The variable to store. |
true
if the variable was written, false
if not which typically indicates that this plug-in is not able to write values. Reimplemented in IniFile, and InMemoryPlugin.
|
inlinevirtual |
Convenience method that parses the values from the given string using field StringConverter and then invokes Store.
variable | The variable to store. |
externalizedValue | The value to parse into the variable before storing |
true
if the variable was written, false
if not which typically indicates that this plug-in is not able to write values.
|
protected |
The default external string converter
XTernalizer StringConverter |
The external string converter. By default this points to field defaultStringConverter.