42 constexpr T
get()
const noexcept;
49 constexpr std::expected<void, layered_configs_manager::set_error>
set(T value) noexcept;
56 string_view m_svRuntimeName;
121 string_view m_svRuntimeName;
A builder for creating layered_config_variable instances.
consteval layered_config_variable_builder(string_view svRuntimeName, T defaultValue={}) noexcept
layered_config_variable_builder object constructor
consteval layered_config_variable_builder env(string_view svEnvName) noexcept
Add environment variable layer with specified name.
consteval layered_config_variable_builder command_line(string_view svFullName, string_view svShortName={})
Add command line argument layer with specified full and short names. Full name should start with "--"...
layered_config_variable< T > build() noexcept
Finalize building layered_config_variable instance and add it to layered_configs_manager.
consteval layered_config_variable_builder group(string_view svGroupName) noexcept
Set the group name for the variable.
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,...
consteval layered_config_variable_builder description(string_view svDescription) noexcept
Set the description for the variable.
A configuration variable that can be set from different layers (default value, environment variable,...
constexpr std::expected< void, layered_configs_manager::set_error > set(T value) noexcept
Set variable value at runtime. It will override value from all other layers.
constexpr T get() const noexcept
Get variable value. If the variable is not set in any layer or has invalid value, the default value w...