goptions
Loading...
Searching...
No Matches
GVariable Struct Reference

Encapsulates a variable with a name, value, and description. More...

#include <goption.h>

Collaboration diagram for GVariable:
Collaboration graph

Public Member Functions

 GVariable (std::string n, std::string val, std::string d)
 Constructor for initializing a variable with a string value.
 
 GVariable (std::string n, double val, std::string d)
 Constructor for initializing a variable with a double value.
 
 GVariable (std::string n, const char *val, std::string d)
 Constructor for initializing a variable with a const char* value.
 
 GVariable (std::string n, int val, std::string d)
 Constructor for initializing a variable with an integer value.
 
 GVariable (std::string n, bool val, std::string d)
 Constructor for initializing a variable with a boolean value.
 

Data Fields

std::string name
 The name of the variable.
 
std::string value
 The value of the variable, stored as a string.
 
std::string description
 A brief description of the variable.
 

Detailed Description

The GVariable struct provides a flexible way to store and manage different types of variables, with overloaded constructors to support strings, integers, doubles, and booleans.

Definition at line 24 of file goption.h.

Constructor & Destructor Documentation

◆ GVariable() [1/5]

GVariable::GVariable ( std::string n,
std::string val,
std::string d )
inline
Parameters
nName of the variable.
valValue of the variable.
dDescription of the variable.

Definition at line 35 of file goption.h.

◆ GVariable() [2/5]

GVariable::GVariable ( std::string n,
double val,
std::string d )
inline
Parameters
nName of the variable.
valValue of the variable.
dDescription of the variable.

Definition at line 45 of file goption.h.

◆ GVariable() [3/5]

GVariable::GVariable ( std::string n,
const char * val,
std::string d )
inline
Parameters
nName of the variable.
valValue of the variable.
dDescription of the variable.

Definition at line 54 of file goption.h.

◆ GVariable() [4/5]

GVariable::GVariable ( std::string n,
int val,
std::string d )
inline
Parameters
nName of the variable.
valValue of the variable.
dDescription of the variable.

Definition at line 64 of file goption.h.

◆ GVariable() [5/5]

GVariable::GVariable ( std::string n,
bool val,
std::string d )
inline
Parameters
nName of the variable.
valBoolean value of the variable.
dDescription of the variable.

Definition at line 73 of file goption.h.

Field Documentation

◆ description

std::string GVariable::description

Definition at line 27 of file goption.h.

◆ name

std::string GVariable::name

Definition at line 25 of file goption.h.

◆ value

std::string GVariable::value

Definition at line 26 of file goption.h.


The documentation for this struct was generated from the following file: