6#include "validatorresult_p.h"
14 : d(new ValidatorResultPrivate)
36 fieldErrors.
append(message);
37 d->errors.insert(field, fieldErrors);
44 for (
const auto &error : d->errors) {
58 return d->errors.
value(field);
63 return d->errors.contains(field);
70 for (
const auto &[key, error] : d->errors.asKeyValueRange()) {
89 return d->values.
value(field);
94 d->values.insert(field,
value);
104 return d->extras.
value(field);
109 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