ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Inner Classes | Public Fields | Public Methods | Protected Methods | List of all members
InMemoryPlugin Class Reference
Inheritance diagram for InMemoryPlugin:
[legend]
Collaboration diagram for InMemoryPlugin:
[legend]

Class Description


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< SectionSections = 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()
 

Constructor & Destructor Documentation

◆ InMemoryPlugin()

InMemoryPlugin ( )
inline

Constructor.

Member Function Documentation

◆ createSection()

virtual Section createSection ( Object  name)
inlineprotectedvirtual

Virtual method to create a section. (Provided to allow descendant classes to created extended versions of an entry.)

Parameters
nameThe name of the section
Returns
An object of type InMemoryPlugIn.Section.

Reimplemented in IniFile.

◆ Load()

override bool Load ( Variable  variable,
bool  searchOnly = false 
)
inlinevirtual

Searches the variable in our storage.

Parameters
variableThe variable to retrieve.
searchOnlyIf true, the variable is not read. Defaults to false.
Returns
true if variable was found, false if not.

Implements ConfigurationPlugin.

◆ Reset()

virtual void Reset ( )
inlinevirtual

Clears all configuration data and adds a fresh anonymous section

Reimplemented in IniFile.

◆ SearchOrCreateSection()

Section SearchOrCreateSection ( Object  name,
AString  comments 
)
inline

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.

Parameters
nameThe name of the section to be retrieved.
commentsThe comment lines for the section, in the case the section is not found. If this is null, no section comments are created.
Returns
Returns the section if it was found or created. null otherwise.

◆ SearchSection()

Section SearchSection ( Object  name)
inline

Searches the Section with the given name.

Parameters
nameThe name of the section to be retrieved.
Returns
Returns the section if it was found, null otherwise.

◆ Store()

override bool Store ( Variable  variable)
inlinevirtual

Creates or replaces existing variable in our storage.

Parameters
variableThe variable to retrieve.
Returns
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.

Member Data Documentation

◆ Sections

List<Section> Sections = new List<Section>()

The list of sections.


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