Cute Chess  0.1
Classes | Public Member Functions | List of all members
MatchParser Class Reference

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< Optionoptions () const
 
bool parse ()
 
QVariant takeOption (const QString &name)
 

Detailed Description

A command line parser for EngineMatch options.

See also
EngineMatch

Constructor & Destructor Documentation

MatchParser::MatchParser ( const QStringList args)

Constructs a new parser for parsing args.

Member Function Documentation

void MatchParser::addOption ( const QString name,
QVariant::Type  type,
int  minArgs = 0,
int  maxArgs = -1,
bool  duplicates = false 
)

Adds a new command line option.

Parameters
nameThe name of the option.
typeThe storage type of the option's value. For options with multiple arguments this should be set to QVariant::QStringList.
minArgsThe minimum number of arguments.
maxArgsThe maximum number of arguments. A value of -1 represents infinity.
duplicatesIf 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.

QVariant MatchParser::takeOption ( const QString name)

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.


The documentation for this class was generated from the following files: