Specialization of abstract interface class ConfigurationPlugin, which holds configuration variables in memory. Instances of this class are used to create two plug-ins within standard configurations:
This class in addition acts as the parent of class IniFile and potentially other (custom) classes. For this reason, it divides the set of variables into sections (according to the category), allows comment strings for variables and sections, and virtualizes the some key methods to allow descendants to take specific actions.
This class offers important internal fields and types for public access (bauhaus code style). However, in standard cases, only the interface methods of this class should be used.
Inner Classes | |
class | Entry |
class | Section |
Public Fields | |
List< Section > | Sections = new List<Section>() |
Public Fields inherited from ConfigurationPlugin | |
XTernalizer | StringConverter |
Public Methods | |
InMemoryPlugin () | |
override bool | Load (Variable variable, bool searchOnly=false) |
virtual void | Reset () |
Section | SearchOrCreateSection (Object name, AString comments) |
Section | SearchSection (Object name) |
override bool | Store (Variable variable) |
Public Methods inherited from ConfigurationPlugin | |
virtual bool | Store (Variable variable, Object externalizedValue) |
Protected Methods | |
virtual Section | createSection (Object name) |
Protected Methods inherited from ConfigurationPlugin | |
ConfigurationPlugin () | |
Additional Inherited Members | |
Protected Fields inherited from ConfigurationPlugin | |
XTernalizer | defaultStringConverter = new XTernalizer() |
|
inline |
Constructor.
|
inlineprotectedvirtual |
Virtual method to create a section. (Provided to allow descendant classes to created extended versions of an entry.)
name | The name of the section |
Reimplemented in IniFile.
|
inlinevirtual |
Searches the variable in our storage.
variable | The variable to retrieve. |
searchOnly | If true , the variable is not read. Defaults to false . |
true
if variable was found, false
if not. Implements ConfigurationPlugin.
|
inlinevirtual |
Searches the Section with the given name. If the section was not found, it is created. If the section is found and has no comments, then the provided comments are appended.
name | The name of the section to be retrieved. |
comments | The comment lines for the section, in the case the section is not found. If this is null, no section comments are created. |
null
otherwise.
|
inline |
Searches the Section with the given name.
name | The name of the section to be retrieved. |
null
otherwise.
|
inlinevirtual |
Creates or replaces existing variable in our storage.
variable | The variable to retrieve. |
true
if the variable was written, false
if not. The latter might only happen if the variable given was illegal, e.g. empty name. Reimplemented from ConfigurationPlugin.