mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Qcommandlineparser (#199)
* Replaced getoptplusplus with QCommandLineParser. Fixes #39 * enabling C++11 if possible * enabling C++11 if possible * fixed gcc compilation issues * fixed linux builds and improved os x build * trying to fix dispmanx * trying to fix dispmanx * simplified travis build script * fixed argumentparser default values * rewrote validator system and made sure default arguments are processed correctly * rewrote validator system and made sure default arguments are processed correctly * fixed bool vs. regular options * oops... removing debug code * reverted screenshot api change
This commit is contained in:
committed by
redPanther
parent
c13f2e20ec
commit
61db9f43b8
35
include/commandline/BooleanOption.h
Normal file
35
include/commandline/BooleanOption.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef HYPERION_BOOLEANOPTION_H
|
||||
#define HYPERION_BOOLEANOPTION_H
|
||||
|
||||
|
||||
#include <QtCore>
|
||||
#include "Option.h"
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class BooleanOption: public Option
|
||||
{
|
||||
public:
|
||||
BooleanOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(name, description, QString(), QString())
|
||||
{}
|
||||
BooleanOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(names, description, QString(), QString())
|
||||
{}
|
||||
BooleanOption(const QCommandLineOption &other)
|
||||
: Option(other)
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_BOOLEANOPTION_H
|
41
include/commandline/ColorOption.h
Normal file
41
include/commandline/ColorOption.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef HYPERION_COLOROPTION_H
|
||||
#define HYPERION_COLOROPTION_H
|
||||
|
||||
#include "Option.h"
|
||||
#include <QColor>
|
||||
#include <QCommandLineParser>
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class ColorOption: public Option
|
||||
{
|
||||
protected:
|
||||
QColor _color;
|
||||
public:
|
||||
ColorOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(name, description, valueName, defaultValue)
|
||||
{}
|
||||
ColorOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(names, description, valueName, defaultValue)
|
||||
{}
|
||||
ColorOption(const QCommandLineOption &other)
|
||||
: Option(other)
|
||||
{}
|
||||
|
||||
virtual bool validate(Parser & parser, QString & value) override;
|
||||
QColor getColor(Parser &parser)
|
||||
{ return _color; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_COLOROPTION_H
|
41
include/commandline/ColorsOption.h
Normal file
41
include/commandline/ColorsOption.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef HYPERION_COLORSOPTION_H
|
||||
#define HYPERION_COLORSOPTION_H
|
||||
|
||||
#include "Option.h"
|
||||
#include <QColor>
|
||||
#include <QCommandLineParser>
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class ColorsOption: public Option
|
||||
{
|
||||
protected:
|
||||
QList<QColor> _colors;
|
||||
public:
|
||||
ColorsOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(name, description, valueName, defaultValue)
|
||||
{}
|
||||
ColorsOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(names, description, valueName, defaultValue)
|
||||
{}
|
||||
ColorsOption(const QCommandLineOption &other)
|
||||
: Option(other)
|
||||
{}
|
||||
|
||||
virtual bool validate(Parser & parser, QString & value) override;
|
||||
QList<QColor> &getColors(Parser &parser)
|
||||
{ return _colors; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_COLOROPTION_H
|
40
include/commandline/DoubleOption.h
Normal file
40
include/commandline/DoubleOption.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef HYPERION_DOUBLECOMMANDLINEOPTION_H
|
||||
#define HYPERION_DOUBLECOMMANDLINEOPTION_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "ValidatorOption.h"
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class DoubleOption: public ValidatorOption
|
||||
{
|
||||
protected:
|
||||
double _double;
|
||||
public:
|
||||
DoubleOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000)
|
||||
: ValidatorOption(name, description, valueName, defaultValue)
|
||||
{ setValidator(new QDoubleValidator(minimum, maximum, decimals)); }
|
||||
DoubleOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000)
|
||||
: ValidatorOption(names, description, valueName, defaultValue)
|
||||
{ setValidator(new QDoubleValidator(minimum, maximum, decimals)); }
|
||||
DoubleOption(const QCommandLineOption &other,
|
||||
double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000)
|
||||
: ValidatorOption(other)
|
||||
{ setValidator(new QDoubleValidator(minimum, maximum, decimals)); }
|
||||
|
||||
double getDouble(Parser &parser, bool *ok = 0);
|
||||
double *getDoublePtr(Parser &parser, bool *ok = 0);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_DOUBLECOMMANDLINEOPTION_H
|
41
include/commandline/ImageOption.h
Normal file
41
include/commandline/ImageOption.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef HYPERION_IMAGEOPTION_H
|
||||
#define HYPERION_IMAGEOPTION_H
|
||||
|
||||
#include "Option.h"
|
||||
#include <QImage>
|
||||
#include <QCommandLineParser>
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class ImageOption: public Option
|
||||
{
|
||||
protected:
|
||||
QImage _image;
|
||||
public:
|
||||
ImageOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(name, description, valueName, defaultValue)
|
||||
{}
|
||||
ImageOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: Option(names, description, valueName, defaultValue)
|
||||
{}
|
||||
ImageOption(const QCommandLineOption &other)
|
||||
: Option(other)
|
||||
{}
|
||||
|
||||
virtual bool validate(Parser & parser, QString & value) override;
|
||||
QImage &getImage(Parser &parser)
|
||||
{ return _image; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_IMAGEOPTION_H
|
41
include/commandline/IntOption.h
Normal file
41
include/commandline/IntOption.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef HYPERION_INTCOMMANDLINEOPTION_H
|
||||
#define HYPERION_INTCOMMANDLINEOPTION_H
|
||||
|
||||
#include <limits>
|
||||
#include <QtCore>
|
||||
#include "ValidatorOption.h"
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class IntOption: public ValidatorOption
|
||||
{
|
||||
protected:
|
||||
int _int;
|
||||
public:
|
||||
IntOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
int minimum = std::numeric_limits<int>::min(), int maximum = std::numeric_limits<int>::max())
|
||||
: ValidatorOption(name, description, valueName, defaultValue)
|
||||
{ setValidator(new QIntValidator(minimum, maximum)); }
|
||||
IntOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
int minimum = std::numeric_limits<int>::min(), int maximum = std::numeric_limits<int>::max())
|
||||
: ValidatorOption(names, description, valueName, defaultValue)
|
||||
{ setValidator(new QIntValidator(minimum, maximum)); }
|
||||
IntOption(const QCommandLineOption &other,
|
||||
int minimum = std::numeric_limits<int>::min(), int maximum = std::numeric_limits<int>::max())
|
||||
: ValidatorOption(other)
|
||||
{ setValidator(new QIntValidator(minimum, maximum)); }
|
||||
|
||||
int getInt(Parser &parser, bool *ok = 0, int base = 10);
|
||||
int *getIntPtr(Parser &parser, bool *ok = 0, int base = 10);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_INTCOMMANDLINEOPTION_H
|
49
include/commandline/Option.h
Normal file
49
include/commandline/Option.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef HYPERION_OPTION_H
|
||||
#define HYPERION_OPTION_H
|
||||
|
||||
#include <QCommandLineOption>
|
||||
#include <QCommandLineParser>
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class Parser;
|
||||
|
||||
/* Note, this class and all it's derivatives store the validated results for caching. This means that unlike the
|
||||
* regular QCommandLineOption it is _not_ idempotent! */
|
||||
class Option: public QCommandLineOption
|
||||
{
|
||||
protected:
|
||||
QString _error;
|
||||
public:
|
||||
Option(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString::null,
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: QCommandLineOption(name, description, valueName, defaultValue)
|
||||
{}
|
||||
Option(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString::null,
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: QCommandLineOption(names, description, valueName, defaultValue)
|
||||
{}
|
||||
Option(const QCommandLineOption &other)
|
||||
: QCommandLineOption(other)
|
||||
{}
|
||||
|
||||
virtual bool validate(Parser &parser, QString &value);
|
||||
QString name()
|
||||
{ return this->names().last();}
|
||||
QString getError()
|
||||
{ return this->_error; }
|
||||
QString value(Parser &parser);
|
||||
std::string getStdString(Parser &parser);
|
||||
std::wstring getStdWString(Parser &parser);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_OPTION_H
|
120
include/commandline/Parser.h
Normal file
120
include/commandline/Parser.h
Normal file
@@ -0,0 +1,120 @@
|
||||
#ifndef HYPERION_COMMANDLINEPARSER_H
|
||||
#define HYPERION_COMMANDLINEPARSER_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include "ColorOption.h"
|
||||
#include "ColorsOption.h"
|
||||
#include "DoubleOption.h"
|
||||
#include "ImageOption.h"
|
||||
#include "IntOption.h"
|
||||
#include "Option.h"
|
||||
#include "RegularExpressionOption.h"
|
||||
#include "SwitchOption.h"
|
||||
#include "ValidatorOption.h"
|
||||
#include "BooleanOption.h"
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class Parser : public QObject
|
||||
{
|
||||
protected:
|
||||
QHash<QString, Option *> _options;
|
||||
QString _errorText;
|
||||
/* No public inheritance because we need to modify a few methods */
|
||||
QCommandLineParser _parser;
|
||||
|
||||
QStringList _getNames(const char shortOption, const QString longOption);
|
||||
QString _getDescription(const QString description, const QString default_=QString());
|
||||
|
||||
public:
|
||||
bool parse(const QStringList &arguments);
|
||||
void process(const QStringList &arguments);
|
||||
void process(const QCoreApplication &app);
|
||||
QString errorText() const;
|
||||
|
||||
template<class OptionT, class ... Args>
|
||||
OptionT &add(
|
||||
const char shortOption,
|
||||
const QString longOption,
|
||||
const QString description,
|
||||
const QString default_,
|
||||
Args ... args)
|
||||
{
|
||||
OptionT * option = new OptionT(
|
||||
_getNames(shortOption, longOption),
|
||||
_getDescription(description, default_),
|
||||
longOption,
|
||||
default_,
|
||||
args...);
|
||||
addOption(option);
|
||||
return *option;
|
||||
}
|
||||
|
||||
/* gcc does not support default arguments for variadic templates which
|
||||
* makes this method necessary */
|
||||
template<class OptionT>
|
||||
OptionT &add(
|
||||
const char shortOption,
|
||||
const QString longOption,
|
||||
const QString description,
|
||||
const QString default_ = QString())
|
||||
{
|
||||
OptionT * option = new OptionT(
|
||||
_getNames(shortOption, longOption),
|
||||
_getDescription(description, default_),
|
||||
longOption,
|
||||
default_);
|
||||
addOption(option);
|
||||
return *option;
|
||||
}
|
||||
|
||||
Parser(QString description=QString())
|
||||
{if(description.size())setApplicationDescription(description);};
|
||||
QCommandLineOption addHelpOption()
|
||||
{ return _parser.addHelpOption(); }
|
||||
bool addOption(Option &option);
|
||||
bool addOption(Option *option);
|
||||
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax = QString())
|
||||
{ _parser.addPositionalArgument(name, description, syntax); }
|
||||
QCommandLineOption addVersionOption()
|
||||
{ return _parser.addVersionOption(); }
|
||||
QString applicationDescription() const
|
||||
{ return _parser.applicationDescription(); }
|
||||
void clearPositionalArguments()
|
||||
{ _parser.clearPositionalArguments(); }
|
||||
QString helpText() const
|
||||
{ return _parser.helpText(); }
|
||||
bool isSet(const QString &name) const
|
||||
{ return _parser.isSet(name); }
|
||||
bool isSet(const Option &option) const
|
||||
{ return _parser.isSet(option); }
|
||||
bool isSet(const Option *option) const
|
||||
{ return _parser.isSet(*option); }
|
||||
QStringList optionNames() const
|
||||
{ return _parser.optionNames(); }
|
||||
QStringList positionalArguments() const
|
||||
{ return _parser.positionalArguments(); }
|
||||
void setApplicationDescription(const QString &description)
|
||||
{ _parser.setApplicationDescription(description); }
|
||||
void setSingleDashWordOptionMode(QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode)
|
||||
{ _parser.setSingleDashWordOptionMode(singleDashWordOptionMode); }
|
||||
void showHelp(int exitCode = 0)
|
||||
{ _parser.showHelp(exitCode); }
|
||||
QStringList unknownOptionNames() const
|
||||
{ return _parser.unknownOptionNames(); }
|
||||
QString value(const QString &optionName) const
|
||||
{ return _parser.value(optionName); }
|
||||
QString value(const Option &option) const
|
||||
{ return _parser.value(option); }
|
||||
QStringList values(const QString &optionName) const
|
||||
{ return _parser.values(optionName); }
|
||||
QStringList values(const Option &option) const
|
||||
{ return _parser.values(option); }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_COMMANDLINEPARSER_H
|
71
include/commandline/RegularExpressionOption.h
Normal file
71
include/commandline/RegularExpressionOption.h
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H
|
||||
#define HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <QRegularExpression>
|
||||
#include "ValidatorOption.h"
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class RegularExpressionOption: public ValidatorOption
|
||||
{
|
||||
public:
|
||||
RegularExpressionOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString())
|
||||
: ValidatorOption(name, description, valueName, defaultValue)
|
||||
{}
|
||||
RegularExpressionOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString())
|
||||
: ValidatorOption(names, description, valueName, defaultValue)
|
||||
{}
|
||||
RegularExpressionOption(const QCommandLineOption &other)
|
||||
: ValidatorOption(other)
|
||||
{}
|
||||
|
||||
RegularExpressionOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QRegularExpression &expression = QRegularExpression())
|
||||
: ValidatorOption(name, description, valueName, defaultValue)
|
||||
{ setValidator(new QRegularExpressionValidator(expression)); }
|
||||
RegularExpressionOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QRegularExpression &expression = QRegularExpression())
|
||||
: ValidatorOption(names, description, valueName, defaultValue)
|
||||
{ setValidator(new QRegularExpressionValidator(expression)); }
|
||||
RegularExpressionOption(const QCommandLineOption &other,
|
||||
const QRegularExpression &expression = QRegularExpression())
|
||||
: ValidatorOption(other)
|
||||
{ setValidator(new QRegularExpressionValidator(expression)); }
|
||||
|
||||
RegularExpressionOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QString &expression = QString())
|
||||
: ValidatorOption(name, description, valueName, defaultValue)
|
||||
{ setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); }
|
||||
RegularExpressionOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QString &expression = QString())
|
||||
: ValidatorOption(names, description, valueName, defaultValue)
|
||||
{ setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); }
|
||||
RegularExpressionOption(const QCommandLineOption &other,
|
||||
const QString &expression = QString())
|
||||
: ValidatorOption(other)
|
||||
{ setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H
|
45
include/commandline/SwitchOption.h
Normal file
45
include/commandline/SwitchOption.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef HYPERION_SWITCHCOMMANDLINEOPTION_H
|
||||
#define HYPERION_SWITCHCOMMANDLINEOPTION_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "Option.h"
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
template <class T>
|
||||
class SwitchOption: public Option
|
||||
{
|
||||
protected:
|
||||
QMap<QString, T> _switches;
|
||||
public:
|
||||
SwitchOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QMap<QString, T> &switches=QMap<QString, T>())
|
||||
: Option(name, description, valueName, defaultValue), _switches(switches)
|
||||
{}
|
||||
SwitchOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QMap<QString, T> &switches=QMap<QString, T>())
|
||||
: Option(names, description, valueName, defaultValue), _switches(switches)
|
||||
{}
|
||||
SwitchOption(const QCommandLineOption &other, const QMap<QString, T> &switches)
|
||||
: Option(other), _switches(switches)
|
||||
{}
|
||||
|
||||
const QMap<QString, T> &getSwitches() const{return _switches;};
|
||||
virtual bool validate(Parser &parser, QString &switch_) override{return hasSwitch(switch_);}
|
||||
bool hasSwitch(const QString &switch_){return _switches.contains(switch_.toLower());}
|
||||
void setSwitches(const QMap<QString, T> &_switches){this->_switches = _switches;}
|
||||
void addSwitch(const QString &switch_, T value=T()){_switches[switch_.toLower()] = value;}
|
||||
void removeSwitch(const QString &switch_){_switches.remove(switch_.toLower());}
|
||||
T & switchValue(Parser & parser){return _switches[value(parser).toLower()];}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_SWITCHCOMMANDLINEOPTION_H
|
42
include/commandline/ValidatorOption.h
Normal file
42
include/commandline/ValidatorOption.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef HYPERION_COMMANDLINEOPTION_H
|
||||
#define HYPERION_COMMANDLINEOPTION_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <commandline/Option.h>
|
||||
|
||||
namespace commandline
|
||||
{
|
||||
|
||||
class ValidatorOption: public Option
|
||||
{
|
||||
protected:
|
||||
const QValidator *validator;
|
||||
virtual void setValidator(const QValidator *validator);
|
||||
public:
|
||||
ValidatorOption(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QValidator *validator = nullptr)
|
||||
: Option(name, description, valueName, defaultValue), validator(validator)
|
||||
{}
|
||||
ValidatorOption(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString(),
|
||||
const QValidator *validator = nullptr)
|
||||
: Option(names, description, valueName, defaultValue), validator(validator)
|
||||
{}
|
||||
ValidatorOption(const QCommandLineOption &other,
|
||||
const QValidator *validator = nullptr)
|
||||
: Option(other), validator(validator)
|
||||
{}
|
||||
|
||||
virtual const QValidator *getValidator() const;
|
||||
virtual bool validate(Parser & parser, QString &value) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_COMMANDLINEOPTION_H
|
Reference in New Issue
Block a user