|
qxLib
|
A builder for creating layered_config_variable instances. More...
#include <layered_config_variable.h>
Public Member Functions | |
| consteval | layered_config_variable_builder (cstring_view svRuntimeName, T defaultValue={}) noexcept |
| layered_config_variable_builder object constructor More... | |
| consteval layered_config_variable_builder | env (cstring_view svEnvName) noexcept |
| Add environment variable layer with specified name. More... | |
| consteval layered_config_variable_builder | command_line (cstring_view svFullName, cstring_view svShortName={}) noexcept |
| Add command line argument layer with specified full and short names. Full name should start with "--", short name should start with "-" or be empty. More... | |
| consteval layered_config_variable_builder | group (cstring_view svGroupName) noexcept |
| Set the group name for the variable. More... | |
| consteval layered_config_variable_builder | description (cstring_view svDescription) noexcept |
| Set the description for the variable. More... | |
| consteval layered_config_variable_builder | required () noexcept |
| Mark variable as required. If a required variable is not set in any layer or has invalid value, layered_configs_manager::parse() will log errors and return false. | |
| layered_config_variable< T > | build () noexcept |
| Finalize building layered_config_variable instance and add it to layered_configs_manager. More... | |
A builder for creating layered_config_variable instances.
| T | - variable type |
Definition at line 68 of file layered_config_variable.h.
|
noexcept |
layered_config_variable_builder object constructor
| svRuntimeName | - runtime name of variable |
| defaultValue | - a value to be used if the variable is not set in any layer or has invalid value |
Definition at line 27 of file layered_config_variable.inl.
|
noexcept |
Finalize building layered_config_variable instance and add it to layered_configs_manager.
| - | built layered_config_variable instance |
Definition at line 115 of file layered_config_variable.inl.
|
noexcept |
Add command line argument layer with specified full and short names. Full name should start with "--", short name should start with "-" or be empty.
| svFullName | - full name of command line argument |
| svShortName | - short name of command line argument |
Definition at line 76 of file layered_config_variable.inl.
|
noexcept |
Set the description for the variable.
This description will be shown in help messages.
| svDescription | - description of the variable |
Definition at line 100 of file layered_config_variable.inl.
|
noexcept |
Add environment variable layer with specified name.
| svEnvName | - name of environment variable |
Definition at line 69 of file layered_config_variable.inl.
|
noexcept |
Set the group name for the variable.
Variables with the same group name can be displayed together in help messages.
| svGroupName | - group name |
Definition at line 92 of file layered_config_variable.inl.