8 #include "gutsConventions.h"
21 #include "yaml-cpp/yaml.h"
98 GOption(
GVariable dv,
string h) : name(dv.name), description(dv.description), help(h) {
99 defaultValue = YAML::Load(name +
": " + dv.
value);
100 value = defaultValue;
114 GOption(
string n,
string desc, vector <GVariable> dv,
string h) : name(n), description(desc), help(h) {
117 for (
const auto &v: dv) {
118 YAML::Node this_node = YAML::Load(v.name +
": " + v.value);
119 nodes.push_back(this_node);
120 gvar_descs.push_back(v.description);
123 mandatory_keys.push_back(v.name);
126 defaultValue[n] = nodes;
130 value = defaultValue;
136 bool isCumulative =
false;
138 const string description;
160 YAML::Node defaultValue;
161 vector <string> gvar_descs;
162 vector <string> mandatory_keys;
169 void saveOption(std::ofstream *yamlConf)
const;
175 void printHelp(
bool detailed)
const;
181 string detailedHelp()
const;
187 void set_scalar_value(
const string &v);
193 void set_value(
const YAML::Node &v);
200 bool does_the_option_set_all_necessary_values(YAML::Node v);
Represents a configurable option with a name, value, description, and help text.
GOption(string n, string desc, vector< GVariable > dv, string h)
Constructor for a sequence option.
GOption(GVariable dv, string h)
Constructor for a scalar option with a default value.
The GOptions class manages command-line options and switches.
Encapsulates a variable with a name, value, and description.
string value
The value of the variable, stored as a string.
string description
A brief description of the variable.
GVariable(string n, const char *val, string d)
Constructor for initializing a variable with an integer value.
GVariable(string n, string val, string d)
Constructor for initializing a variable with a string value.
string name
The name of the variable.
GVariable(string n, int val, string d)
Constructor for initializing a variable with a double value.
GVariable(string n, double val, string d)
Constructor for initializing a variable with a string value.
GVariable(string n, bool val, string d)
Constructor for initializing a variable with a boolean value.