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.
|
| |
|
| std::string | name |
| | Variable name (option name for scalar options, schema key name for structured options).
|
| |
| std::string | value |
| | Default value as a string (or goptions::NODFLT : to mark as mandatory).
|
| |
| 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).
Values are stored internally as strings for uniform YAML construction and printing.
Definition at line 33 of file goption.h.
◆ GVariable() [1/5]
| GVariable::GVariable |
( |
std::string | n, |
|
|
std::string | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Default value (string) or goptions::NODFLT : . |
| d | Description displayed in help. |
Definition at line 45 of file goption.h.
◆ GVariable() [2/5]
| GVariable::GVariable |
( |
std::string | n, |
|
|
double | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Default value (double), converted to string. |
| d | Description displayed in help. |
Definition at line 55 of file goption.h.
◆ GVariable() [3/5]
| 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 64 of file goption.h.
◆ GVariable() [4/5]
| GVariable::GVariable |
( |
std::string | n, |
|
|
int | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Default value (int), converted to string. |
| d | Description displayed in help. |
Definition at line 74 of file goption.h.
◆ GVariable() [5/5]
| GVariable::GVariable |
( |
std::string | n, |
|
|
bool | val, |
|
|
std::string | d ) |
|
inline |
- Parameters
-
| n | Name of the variable. |
| val | Default value (bool), stored as "true" or "false". |
| d | Description displayed in help. |
Definition at line 83 of file goption.h.
◆ description
| std::string GVariable::description |
◆ name
| std::string GVariable::name |
◆ value
| std::string GVariable::value |
The documentation for this struct was generated from the following file: