ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
EnvironmentVariablesPlugin Class Reference

Description:

Specialization of abstract interface class ConfigurationPlugin, retrieves configuration data from the system environment.

The priority value of this plug-in usually is Priority::Environment, which is higher than Standard but lower than CLI.

To recognize variables, the separation character '/' of the configuration tree is converted to underscore character '_'. For example, the ALib locale variable with path ALIB/LOCALE is recognized as ALIB_LOCALE

Category and Variable names are insensitive in respect to character case.

Definition at line 184 of file config/plugins.hpp.

#include <plugins.hpp>

Inheritance diagram for EnvironmentVariablesPlugin:
[legend]
Collaboration diagram for EnvironmentVariablesPlugin:
[legend]

Public Field Index:

StringVectorMA DefaultCategories
 

Public Method Index:

ALIB_API EnvironmentVariablesPlugin (MonoAllocator &ma, Priority pPriority=Priority::Environment)
 
virtual ~EnvironmentVariablesPlugin () override
 Virtual Destructor.
 
virtual ALIB_API bool Get (const String &name, AString &target) override
 
virtual ALIB_API String Name () const override
 
- Public Method Index: inherited from ConfigurationPlugin
virtual ~ConfigurationPlugin ()
 Virtual Destructor.
 
virtual const StringEscaperGetEscaper () const
 
- Public Method Index: inherited from Plugin< Configuration, Priority >
PrioritiesType GetPriority () const
 

Additional Inherited Members

- Public Type Index: inherited from Plugin< Configuration, Priority >
using PluginType
 This exposes the template parameter TPlugin to the outer world.
 
using PrioritiesType
 This exposes the template parameter pTPlugin to the outer world.
 
- Protected Field Index: inherited from ConfigurationPlugin
StringEscaperStandard stringEscaper
 
- Protected Field Index: inherited from Plugin< Configuration, Priority >
PrioritiesType priority
 The priority of this plug-in.
 
- Protected Method Index: inherited from ConfigurationPlugin
 ConfigurationPlugin (Priority pPriority)
 
- Protected Method Index: inherited from Plugin< Configuration, Priority >
 Plugin (PrioritiesType pPriority)
 

Field Details:

◆ DefaultCategories

StringVectorMA DefaultCategories

An application can specify one or more "default categories" by adding a prefix of the variable path here. Variables of these "categories" are recognized by the plug-in also when given without this prefix.
Please note, that if ALib and ALox variables should be abbreviatable, for example that the locale can be given with –locale=de_DE.UTF-8 instead of –alib_locale=de_DE.UTF-8 this vector has to be populated during bootstrap phase PrepareConfig. See chapter 4.6 Customizing The Bootstrap Process for more information on how to customize ALib bootstrapping.

Definition at line 198 of file config/plugins.hpp.

Constructor(s) / Destructor Details:

◆ EnvironmentVariablesPlugin()

EnvironmentVariablesPlugin ( MonoAllocator & ma,
Priority pPriority = Priority::Environment )

Constructor.

Parameters
maThe monotonic allocator to use. This usually is the one of the configuration instance.
pPriorityThe priority that this plug-in uses. Defaults to Environment.

Definition at line 130 of file plugins.cpp.

◆ ~EnvironmentVariablesPlugin()

virtual ~EnvironmentVariablesPlugin ( )
inlineoverridevirtual

Virtual Destructor.

Definition at line 209 of file config/plugins.hpp.

Method Details:

◆ Get()

bool Get ( const String & name,
AString & target )
overridevirtual

Searches the variable in the environment.

Parameters
nameThe name of the variable to retrieve.
[out]targetA reference to the buffer to write the variable's exported value to.
Returns
true if variable was found, false if not.

Implements ConfigurationPlugin.

Definition at line 141 of file plugins.cpp.

Here is the call graph for this function:

◆ Name()

String Name ( ) const
overridevirtual
Returns
The name of the plug-in, in this case, the value of resource variable "CfgPlgEnv".

Implements ConfigurationPlugin.

Definition at line 136 of file plugins.cpp.

Here is the call graph for this function:

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