Describes a schema entry: key name, default value, and user-facing description.
More...
#include <goption.h>
|
| | GVariable (std::string n, std::string val, std::string d) |
| | Constructor for initializing a variable with a string default.
|
| | GVariable (std::string n, double val, std::string d) |
| | Constructor for initializing a variable with a double default.
|
| | GVariable (std::string n, const char *val, std::string d) |
| | Constructor for initializing a variable with a C-string default.
|
| | GVariable (std::string n, int val, std::string d) |
| | Constructor for initializing a variable with an integer default.
|
| | GVariable (std::string n, bool val, std::string d) |
| | Constructor for initializing a variable with a boolean default.
|
| | GVariable (std::string n, std::nullopt_t, std::string d) |
| | GVariable (std::string n, goptions::RequiredValue, std::string d) |
|
| std::string | name |
| | Variable name (option name for scalar options, schema key name for structured options).
|
| YAML::Node | defaultValue |
| | Typed default; null for optional-null and required fields.
|
| bool | required {} |
| | Whether a structured field must be supplied by the user.
|
| std::string | description |
| | Human-readable description used in help output.
|
GVariable : is primarily used when defining options:
- Scalar option: one GVariable : holds option name, default value, and summary description.
- Structured option: a vector of GVariable : entries defines the schema (keys and defaults).
Defaults are stored as typed YAML nodes, while required fields are represented explicitly.
Definition at line 34 of file goption.h.
◆ GVariable() [1/7]
| GVariable::GVariable |
( |
std::string | n, |
|
|
std::string | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Default string value. |
| d | Description displayed in help. |
Definition at line 47 of file goption.h.
◆ GVariable() [2/7]
| GVariable::GVariable |
( |
std::string | n, |
|
|
double | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Typed double default. |
| d | Description displayed in help. |
Definition at line 57 of file goption.h.
◆ GVariable() [3/7]
| GVariable::GVariable |
( |
std::string | n, |
|
|
const char * | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Default value (C-string). |
| d | Description displayed in help. |
Definition at line 67 of file goption.h.
◆ GVariable() [4/7]
| GVariable::GVariable |
( |
std::string | n, |
|
|
int | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Typed integer default. |
| d | Description displayed in help. |
Definition at line 77 of file goption.h.
◆ GVariable() [5/7]
| GVariable::GVariable |
( |
std::string | n, |
|
|
bool | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Typed boolean default. |
| d | Description displayed in help. |
Definition at line 87 of file goption.h.
◆ GVariable() [6/7]
| GVariable::GVariable |
( |
std::string | n, |
|
|
std::nullopt_t | , |
|
|
std::string | d ) |
|
inline |
Construct an option or field whose default is YAML null.
Definition at line 92 of file goption.h.
◆ GVariable() [7/7]
Construct a mandatory structured field.
Definition at line 97 of file goption.h.
◆ defaultValue
| YAML::Node GVariable::defaultValue |
◆ description
| std::string GVariable::description |
◆ name
| std::string GVariable::name |
◆ required
| bool GVariable::required {} |
The documentation for this struct was generated from the following file: