2016-08-28 15:10:43 +02:00
|
|
|
#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)
|
|
|
|
{}
|
2020-08-08 23:12:43 +02:00
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
RegularExpressionOption(const QStringList &names,
|
|
|
|
const QString &description = QString(),
|
|
|
|
const QString &valueName = QString(),
|
|
|
|
const QString &defaultValue = QString())
|
|
|
|
: ValidatorOption(names, description, valueName, defaultValue)
|
|
|
|
{}
|
2020-08-08 23:12:43 +02:00
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
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)
|
2020-08-08 23:12:43 +02:00
|
|
|
{
|
|
|
|
setValidator(new QRegularExpressionValidator(expression));
|
|
|
|
}
|
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
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)
|
2020-08-08 23:12:43 +02:00
|
|
|
{
|
|
|
|
setValidator(new QRegularExpressionValidator(expression));
|
|
|
|
}
|
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
RegularExpressionOption(const QCommandLineOption &other,
|
|
|
|
const QRegularExpression &expression = QRegularExpression())
|
|
|
|
: ValidatorOption(other)
|
2020-08-08 23:12:43 +02:00
|
|
|
{
|
|
|
|
setValidator(new QRegularExpressionValidator(expression));
|
|
|
|
}
|
2016-08-28 15:10:43 +02:00
|
|
|
|
|
|
|
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)
|
2020-08-08 23:12:43 +02:00
|
|
|
{
|
|
|
|
setValidator(new QRegularExpressionValidator(QRegularExpression(expression)));
|
|
|
|
}
|
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
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)
|
2020-08-08 23:12:43 +02:00
|
|
|
{
|
|
|
|
setValidator(new QRegularExpressionValidator(QRegularExpression(expression)));
|
|
|
|
}
|
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
RegularExpressionOption(const QCommandLineOption &other,
|
|
|
|
const QString &expression = QString())
|
|
|
|
: ValidatorOption(other)
|
2020-08-08 23:12:43 +02:00
|
|
|
{
|
|
|
|
setValidator(new QRegularExpressionValidator(QRegularExpression(expression)));
|
|
|
|
}
|
2016-08-28 15:10:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H
|