23 class gsCmdLinePrivate;
78 const char delimiter =
' ',
79 bool helpAndVersion =
true);
94 void addInt(
const std::string& flag,
95 const std::string& name,
96 const std::string& desc,
101 const std::string& name,
102 const std::string& desc,
106 addInt(flag, name, desc, getIntRef(name) );
125 void addMultiInt(
const std::string & flag,
126 const std::string & name,
127 const std::string & desc,
128 std::vector<intVal_t>& value);
145 void addReal(
const std::string& flag,
146 const std::string& name,
147 const std::string& desc,
164 void addMultiReal(
const std::string & flag,
165 const std::string & name,
166 const std::string & desc,
167 std::vector<real_t>& value);
184 void addString(
const std::string& flag,
185 const std::string& name,
186 const std::string& desc,
187 std::string & value);
203 void addMultiString(
const std::string & flag,
204 const std::string & name,
205 const std::string & desc,
206 std::vector<std::string>& value);
224 void addSwitch(
const std::string& flag,
225 const std::string& name,
226 const std::string& desc,
234 const std::string& desc,
238 addSwitch(
"",name,desc,value);
251 void addPlainString(
const std::string& name,
252 const std::string& desc,
253 std::string & value);
265 void getValues(
int argc,
char *argv[]);
268 static void printVersion();
271 std::string& getMessage();
277 bool valid(
int argc,
char *argv[])
const;
280 void setExceptionHandling(
const bool state);
283 bool getExceptionHandling()
const;
292 void updateOptionList();
296 gsCmdLinePrivate * my;
300 #ifdef GISMO_WITH_PYBIND11
305 void pybind11_init_gsCmdLine(pybind11::module &m);
307 #endif // GISMO_WITH_PYBIND11
313 class GISMO_EXPORT gsXml<gsCmdLine> :
public gsXml<gsOptionList> { };
void addNewInt(const std::string &flag, const std::string &name, const std::string &desc, intVal_t value)
Second version: unbinded integer command-line argument.
Definition: gsCmdLine.h:100
#define index_t
Definition: gsConfig.h:32
Class for command-line argument parsing.
Definition: gsCmdLine.h:56
void addInt(const std::string &label, const std::string &desc, const index_t &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:201
Provides a list of labeled parameters/options that can be set and accessed easily.
Provides forward declarations of types and structs.
void addSwitch(const std::string &name, const std::string &desc, bool &value)
Register a switch option for the command line without flag.
Definition: gsCmdLine.h:233
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
void addSwitch(const std::string &label, const std::string &desc, const bool &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:235