6#include "validatornotin_p.h"
15 :
ValidatorRule(*new ValidatorNotInPrivate(field, values, cs, messages, defValKey))
33 vals = d->values.toStringList();
35 vals = c->
stash(d->values.toString()).toStringList();
40 qCWarning(C_VALIDATOR).noquote()
41 <<
debugString(c) <<
"The list of comparison values is empty";
45 qCDebug(C_VALIDATOR).noquote().nospace()
47 <<
"\" is part of the list of not allowed values" << d->values;
65 return c->
qtTrId(
"cutelyst-valnotin-genvalerr");
68 return c->
qtTrId(
"cutelyst-valnotin-genvalerr-label").
arg(_label);
79 return c->
qtTrId(
"cutelyst-validator-genvaldataerr-empty-list");
81 return c->
qtTrId(
"cutelyst-validator-genvaldataerr-empty-list-label").
arg(_label);
void stash(const QVariantHash &unite)
QString qtTrId(const char *id, int n=-1) const
Checks if the field value is not one from a list of values.
ValidatorReturnType validate(Context *c, const ParamsMultiMap ¶ms) const override
~ValidatorNotIn() override
ValidatorNotIn(const QString &field, const QVariant &values, Qt::CaseSensitivity cs=Qt::CaseSensitive, const ValidatorMessages &messages=ValidatorMessages(), const QString &defValKey=QString())
QString genericValidationError(Context *c, const QVariant &errorData=QVariant()) const override
QString genericValidationDataError(Context *c, const QVariant &errorData) const override
Base class for all validator rules.
QString validationError(Context *c, const QVariant &errorData={}) const
QString label(Context *c) const
QString validationDataError(Context *c, const QVariant &errorData={}) 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
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
void setValue(QVariant &&value)
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.