6 #include "validatorboolean_p.h"
12 const QStringList ValidatorBooleanPrivate::trueVals{u
"1"_qs, u
"true"_qs, u
"on"_qs};
13 const QStringList ValidatorBooleanPrivate::falseVals{u
"0"_qs, u
"false"_qs, u
"off"_qs};
18 :
ValidatorRule(*new ValidatorBooleanPrivate(field, messages, defValKey))
37 qCDebug(C_VALIDATOR).noquote().nospace()
38 <<
debugString(c) <<
" \"" << v <<
"\" can not be interpreted as boolean";
54 return c->
qtTrId(
"cutelyst-vaboolean-genvalerr");
58 return c->
qtTrId(
"cutelyst-vaboolean-genvalerr-label").
arg(_label);
QString qtTrId(const char *id, int n=-1) const
QString genericValidationError(Context *c, const QVariant &errorData=QVariant()) const override
~ValidatorBoolean() override
ValidatorBoolean(const QString &field, const ValidatorMessages &messages=ValidatorMessages(), const QString &defValKey=QString())
ValidatorReturnType validate(Context *c, const ParamsMultiMap ¶ms) const override
Base class for all validator rules.
QString validationError(Context *c, const QVariant &errorData={}) const
QString label(Context *c) const
void defaultValue(Context *c, ValidatorReturnType *result) const
QString value(const ParamsMultiMap ¶ms) const
QString debugString(Context *c) const
The Cutelyst namespace holds all public Cutelyst API.
QString arg(Args &&... args) const const
bool isEmpty() const const
void setValue(QVariant &&value)
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.