|
Cute Chess
0.1
|
A command line parser for EngineMatch options. More...
#include <matchparser.h>
Classes | |
| struct | Option |
Public Member Functions | |
| void | addOption (const QString &name, QVariant::Type type, int minArgs=0, int maxArgs=-1, bool duplicates=false) |
| MatchParser (const QStringList &args) | |
| QList< Option > | options () const |
| bool | parse () |
| QVariant | takeOption (const QString &name) |
A command line parser for EngineMatch options.
| MatchParser::MatchParser | ( | const QStringList & | args | ) |
Constructs a new parser for parsing args.
| void MatchParser::addOption | ( | const QString & | name, |
| QVariant::Type | type, | ||
| int | minArgs = 0, |
||
| int | maxArgs = -1, |
||
| bool | duplicates = false |
||
| ) |
Adds a new command line option.
| name | The name of the option. |
| type | The storage type of the option's value. For options with multiple arguments this should be set to QVariant::QStringList. |
| minArgs | The minimum number of arguments. |
| maxArgs | The maximum number of arguments. A value of -1 represents infinity. |
| duplicates | If true, there can be multiple instances of this option. |
| QList< MatchParser::Option > MatchParser::options | ( | ) | const |
Returns the options parsed by parse().
| bool MatchParser::parse | ( | ) |
Parses the command line arguments. Returns true if successful; otherwise returns false.
Returns the value of the option with the name name and removes the option from the parser.
If name doesn't match any parsed option, a null QVariant is returned.
1.8.11