This is the namespace ofALib Module, which implements access, evaluation and writing of configuration variables. Variable data can be load from different sources, for example configuration files, command line parameters, environment variables, or any custom storage type.
Please consult ALib Module Config - Programmer's Manual for further information.
Type Index: | |
struct | Bool |
class | CLIVariablesPlugin |
class | ConfigResourcePool |
class | Configuration |
struct | ConfigurationListener |
class | ConfigurationPlugin |
class | Declaration |
class | EnvironmentVariablesPlugin |
struct | ERPriority |
ALib Enum Record associated with enumeration Priority. More... | |
class | IniFile |
class | IniFileFeeder |
class | TSharedConfiguration |
class | Variable |
struct | VMeta |
Type Definition Index: | |
using | StringVectorComma = alib::StringVectorPA |
using | StringVectorSemicolon = alib::StringVectorPA |
Enumeration Index: | |
enum class | Exceptions { ErrorOpeningFile = 1 , ErrorWritingFile = 2 } |
enum class | Priority : uint16_t { NONE = 0 , AutoDetected = 1000 , DefaultValues = 2000 , Standard = 4000 , ConfigFile = 6000 , Environment = 8000 , SessionFile = 10000 , CLI = 12000 , Session = 14000 , Protected = (std::numeric_limits<uint16_t>::max)() } |
Function Index: | |
variables::Variable | CampVariable (camp::Camp &camp) |
variables::Variable | CampVariable (camp::Camp &camp, const Declaration *decl) |
variables::Variable | CampVariable (camp::Camp &camp, const String &name, const String &typeName, const String &defaultValue=NULL_STRING) |
template<typename TEnum> | |
variables::Variable | CampVariable (camp::Camp &camp, TEnum Enum) |
template<typename TEnum> requires std::is_enum_v<TEnum> | |
variables::Variable | CampVariable (camp::Camp &camp, TEnum Enum, const Box replacements) |
Type definition used with configuration variables of type "SV,"
, which stores a string array, imported by parsing a comma-separated string list.
Type definition used with configuration variables of type "SV;"
, which stores a string array, imported by parsing a string list separated by character ';'
.
|
strong |
Exception codes of namespace alib::variables.
Enumerator | |
---|---|
ErrorOpeningFile | File not found when reading. |
ErrorWritingFile | An error occurred writing the file . |
Definition at line 385 of file inifile.inl.
|
strong |
Arithmetical enumeration used to control write access to configuration variables, depending on the source of assignable values.
Enumerator | |
---|---|
NONE | This priority value denotes that a variable is undefined and has no value set. The underlying integral value is |
AutoDetected | Constant providing a priority which is even lower than default. A use-case for this priority are for third party libraries that may preset variables in cases where values are estimated or detected instead of defaulted. |
DefaultValues | Used to store default values, either from (resourced) declarations, hard-coded values, or values provided with method Configuration::PresetImportString. The underlying integral value is |
Standard | This is the default priority when a variable is defined for setting a 'hard-coded' value. The underlying integral value is |
ConfigFile | External application configuration sources use this element to define variables found. This element is also used with built-in class IniFileFeeder. The underlying integral value is |
Environment | Used with plug-in EnvironmentVariablesPlugin. The underlying integral value is |
SessionFile | Used to store temporary session information. Those are higher than Environment but lower than CLI. This session priority is only a proposal. Implementations might use a different value, even for different variables, for example Environment - 1 or CLI + 1 . It depends on the use case. |
CLI | Used with plug-in CLIVariablesPlugin. The underlying integral value is |
Session | Used to store generate temporary session information. While usually changes made in source code has a low priority, session information is overwritten by running software, no matter from which external source an existing values came. If software wants to disallow the change of session information imposed by a library or a different software part, still a value can be set to protected. The underlying integral value is |
Protected | Used to define variables with protected values. If all code entities apply to the contract that this camp imposes in respect to variable definitions and priorities, a value set with this priority cannot be manipulated from "outside", hence by config files, command line arguments or any custom configuration source or plug-in. The underlying integral value is |
Definition at line 30 of file variables.prepro.hpp.
|
inline |
Creates an undeclared configuration variable attached to an ALib Camp.
camp | An singleton which supplies the Configuration instance. |
|
inline |
Constructs and declares a variable.
camp | An ALib Camp singleton which supplies the Configuration instance. |
decl | The declaration to use. |
Definition at line 379 of file camp.inl.
|
inline |
Constructs and declares a variable, without using or allocating a declaration struct.
camp | An ALib Camp An ALib Camp singleton which supplies the Configuration instance. |
name | The name of the variable. |
typeName | The type of the variable. |
defaultValue | An optional default value. Defaults to nulled string. |
Definition at line 363 of file camp.inl.
variables::Variable alib::variables::CampVariable | ( | camp::Camp & | camp, |
TEnum | Enum ) |
Constructs and declares a variable.
TEnum | The type of parameter Enum |
camp | An ALib Camp singleton which supplies the Configuration instance. |
Enum | Element of an enum type that represents resourced configuration variables. |
Definition at line 394 of file camp.inl.
variables::Variable alib::variables::CampVariable | ( | camp::Camp & | camp, |
TEnum | Enum, | ||
const Box | replacements ) |
Constructs and declares a variable.
TEnum | The type of parameter Enum |
camp | An ALib Camp singleton which supplies the Configuration instance. |
Enum | Element of an enum type that represents resourced configuration variables. |
replacements | Replacement values. |
Definition at line 416 of file camp.inl.