Base class for script options.
More...
#include <gecode/driver.hh>
|
| | BaseOptions (const char *s) |
| | Initialize options for script with name s.
|
| virtual void | help (void) |
| | Print help text.
|
| void | add (Driver::BaseOption &o) |
| | Add new option o.
|
| void | parse (int &argc, char *argv[]) |
| | Parse options from arguments argv (number is argc).
|
| void | parse (int &argc, char *argv[], bool strict) |
| | Parse options, optionally rejecting unrecognised arguments.
|
| void | parse_strict (int &argc, char *argv[]) |
| | Parse options with strict checking (equivalent to parse() with true).
|
| void | parse_permissive (int &argc, char *argv[]) |
| | Parse options partially (equivalent to parse() with false).
|
| const char * | name (void) const |
| | Return name of script.
|
| void | name (const char *) |
| | Set name of script.
|
| virtual | ~BaseOptions (void) |
| | Destructor.
|
Base class for script options.
Definition at line 391 of file driver.hh.
◆ BaseOptions()
| Gecode::BaseOptions::BaseOptions |
( |
const char * | s | ) |
|
Initialize options for script with name s.
◆ ~BaseOptions()
| virtual Gecode::BaseOptions::~BaseOptions |
( |
void | | ) |
|
|
virtual |
◆ help()
| virtual void Gecode::BaseOptions::help |
( |
void | | ) |
|
|
virtual |
◆ add()
◆ parse() [1/2]
| void Gecode::BaseOptions::parse |
( |
int & | argc, |
|
|
char * | argv[] ) |
Parse options from arguments argv (number is argc).
The options are parsed from position one onwards until no more options are detected. After parsing, the parsed arguments have been removed.
Strict parsing will become the default in a future major release. Use parse_permissive() to explicitly retain partial parsing.
◆ parse() [2/2]
| void Gecode::BaseOptions::parse |
( |
int & | argc, |
|
|
char * | argv[], |
|
|
bool | strict ) |
Parse options, optionally rejecting unrecognised arguments.
With strict set to false, this behaves like the two-argument overload. With strict set to true, any remaining argument causes an error message and help text to be printed, followed by exit with failure. Use strict parsing when no positional arguments or further parsing are expected. SizeOptions and InstanceOptions accept their size or instance as the only remaining argument. Help options are handled as in the two-argument overload.
◆ parse_strict()
| void Gecode::BaseOptions::parse_strict |
( |
int & | argc, |
|
|
char * | argv[] ) |
|
inline |
Parse options with strict checking (equivalent to parse() with true).
Definition at line 195 of file options.hpp.
◆ parse_permissive()
| void Gecode::BaseOptions::parse_permissive |
( |
int & | argc, |
|
|
char * | argv[] ) |
|
inline |
◆ name() [1/2]
| const char * Gecode::BaseOptions::name |
( |
void | | ) |
const |
|
inline |
◆ name() [2/2]
| void Gecode::BaseOptions::name |
( |
const char * | | ) |
|
◆ fst
First registered option.
Definition at line 393 of file driver.hh.
◆ lst
Last registered option.
Definition at line 394 of file driver.hh.
◆ _name
| const char* Gecode::BaseOptions::_name |
|
protected |
The documentation for this class was generated from the following files: