6#include "validatorresult_p.h"
14 : d(new ValidatorResultPrivate)
36 fieldErrors.
append(message);
37 d->errors.insert(field, fieldErrors);
44 auto i = d->errors.constBegin();
45 while (i != d->errors.constEnd()) {
60 return d->errors.
value(field);
65 return d->errors.contains(field);
72 if (!d->errors.empty()) {
73 auto i = d->errors.constBegin();
74 while (i != d->errors.constEnd()) {
95 return d->values.
value(field);
100 d->values.insert(field,
value);
110 return d->extras.
value(field);
115 d->extras.insert(field,
extra);
Provides information about performed validations.
void addExtra(const QString &field, const QVariant &extra)
QStringList failedFields() const
Returns a list of fields with errors.
ValidatorResult & operator=(const ValidatorResult &other) noexcept
QJsonObject errorsJsonObject() const
bool hasErrors(const QString &field) const noexcept
void addValue(const QString &field, const QVariant &value)
QVariant value(const QString &field) const noexcept
QHash< QString, QStringList > errors() const noexcept
void addError(const QString &field, const QString &message)
QVariant extra(const QString &field) const noexcept
QStringList errorStrings() const
QVariantHash values() const noexcept
~ValidatorResult() noexcept
QVariantHash extras() const noexcept
The Cutelyst namespace holds all public Cutelyst API.
QJsonArray fromStringList(const QStringList &list)
QJsonObject::iterator insert(QLatin1StringView key, const QJsonValue &value)
void append(QList::parameter_type value)
T value(qsizetype i) const const