6#include "validatorrequiredwithout_p.h"
26 if (d->otherFields.isEmpty()) {
28 qCWarning(C_VALIDATOR).noquote() <<
"Invalid validation data";
31 bool otherMissing =
false;
36 for (
const QString &other : ofc) {
51 qCDebug(C_VALIDATOR).noquote().nospace()
52 <<
debugString(c) <<
" The field is not present or empty but the field \""
53 << otherField <<
"\" is not present";
72 return c->
qtTrId(
"cutelyst-validator-genvalerr-req");
74 return c->
qtTrId(
"cutelyst-validator-genvalerr-req-label").
arg(_label);
QString qtTrId(const char *id, int n=-1) const
ValidatorRequiredWithout(const QString &field, const QStringList &otherFields, const ValidatorMessages &messages=ValidatorMessages())
~ValidatorRequiredWithout() override
QString genericValidationError(Context *c, const QVariant &errorData=QVariant()) const override
ValidatorReturnType validate(Context *c, const ParamsMultiMap ¶ms) const override
QString field() const noexcept
QString validationError(Context *c, const QVariant &errorData={}) const
QString label(Context *c) const
ValidatorRule(const QString &field, const ValidatorMessages &messages={}, const QString &defValKey={}, QByteArrayView validatorName=nullptr)
QString validationDataError(Context *c, const QVariant &errorData={}) const
QString value(const ParamsMultiMap ¶ms) const
QString debugString(Context *c) const
QMultiMap< QString, QString > ParamsMultiMap
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.