6 #include "validatorrequired_p.h"
12 :
ValidatorRule(*new ValidatorRequiredPrivate(field, messages))
24 qCDebug(C_VALIDATOR).noquote() <<
debugString(c) <<
"Field not found";
33 qCDebug(C_VALIDATOR).noquote() <<
debugString(c) <<
"The field is not present or empty";
47 return c->
qtTrId(
"cutelyst-validator-genvalerr-req");
51 return c->
qtTrId(
"cutelyst-validator-genvalerr-req-label").
arg(_label);
QString qtTrId(const char *id, int n=-1) const
~ValidatorRequired() override
ValidatorReturnType validate(Context *c, const ParamsMultiMap ¶ms) const override
QString genericValidationError(Context *c, const QVariant &errorData=QVariant()) const override
Returns a generic error message.
ValidatorRequired(const QString &field, const ValidatorMessages &messages=ValidatorMessages())
Base class for all validator rules.
QString field() const noexcept
QString validationError(Context *c, const QVariant &errorData={}) const
QString label(Context *c) const
QString value(const ParamsMultiMap ¶ms) const
QString debugString(Context *c) const
The Cutelyst namespace holds all public Cutelyst API.
bool contains(const Key &key) const const
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.