hyperion.ng/libsrc/commandline/Option.cpp
redPanther bfb9a08c80 migrate std::string to qstring + add sysinfo via json (#412)
* std::string -> qstring part 1

* more string migration

* more string migration ...

* ...

* more qstring mogrations
add sysinfo via json

* remove unneccessary includes

* integrate sysinfo into webui
2017-03-04 22:17:42 +01:00

44 lines
960 B
C++

#include "commandline/Option.h"
#include "commandline/Parser.h"
using namespace commandline;
Option::Option(const QString &name, const QString &description, const QString &valueName, const QString &defaultValue)
: QCommandLineOption(name, description, valueName, defaultValue)
{}
Option::Option(const QStringList &names, const QString &description, const QString &valueName, const QString &defaultValue)
: QCommandLineOption(names, description, valueName, defaultValue)
{}
bool Option::validate(Parser & parser, QString &value)
{
/* By default everything is accepted */
return true;
}
Option::Option(const QCommandLineOption &other)
: QCommandLineOption(other)
{}
QString Option::value(Parser &parser)
{
return parser.value(*this);
}
QString Option::name()
{
return this->names().last();
}
QString Option::getError()
{
return this->_error;
}
const char* Option::getCString(Parser &parser)
{
return value(parser).toLocal8Bit().constData();
}