Variant type used to represent configuration values.
More...
#include <dfx-utilities/SystemConfig.hpp>
Variant type used to represent configuration values.
Supported types:
bool
int64_t
double
std::string
This type is a thin wrapper over std::variant that adds helpers and a string conversion utility.
◆ convert_to_string()
| std::string dfx::Utils::SystemConfig::Value::convert_to_string |
( |
| ) |
const |
Convert the held value to a string representation.
This is meant for logging/diagnostics/UI and for formatting via std::format.
- Returns
- A string representation of the held value.
◆ is_bool()
| bool dfx::Utils::SystemConfig::Value::is_bool |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
true if the held type is bool.
◆ is_double()
| bool dfx::Utils::SystemConfig::Value::is_double |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
true if the held type is double.
◆ is_integer()
| bool dfx::Utils::SystemConfig::Value::is_integer |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
true if the held type is int64_t.
◆ is_string()
| bool dfx::Utils::SystemConfig::Value::is_string |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
true if the held type is std::string.
◆ to_bool()
| bool dfx::Utils::SystemConfig::Value::to_bool |
( |
| ) |
const |
|
inline |
Get the value as bool.
- Exceptions
-
| std::bad_variant_access | if the value is not a bool. |
◆ to_double()
| double dfx::Utils::SystemConfig::Value::to_double |
( |
| ) |
const |
|
inline |
Get the value as double.
- Exceptions
-
| std::bad_variant_access | if the value is not a double. |
◆ to_integer()
| int64_t dfx::Utils::SystemConfig::Value::to_integer |
( |
| ) |
const |
|
inline |
Get the value as int64_t.
- Exceptions
-
| std::bad_variant_access | if the value is not an int64_t. |
◆ to_string()
| std::string dfx::Utils::SystemConfig::Value::to_string |
( |
| ) |
const |
|
inline |
Get the value as std::string.
- Exceptions
-
| std::bad_variant_access | if the value is not a std::string. |
The documentation for this struct was generated from the following file: