5#ifndef CUTELYSTVALIDATORRESULT_H
6#define CUTELYSTVALIDATORRESULT_H
8#include <Cutelyst/cutelyst_global.h>
11#include <QSharedDataPointer>
14#include <QVariantHash>
18class ValidatorResultPrivate;
168 explicit operator bool()
const {
return isValid(); }
177 QVariantHash values()
const;
205 QVariantHash extras()
const;
QStringList failedFields() const
Returns a list of fields with errors.
QJsonObject errorsJsonObject() const
Returns the dictionray containing fields with errors as JSON object.
QHash< QString, QStringList > errors() const
Returns a dictionary containing fields with errors.
ValidatorResult & operator=(const ValidatorResult &other)
Assigns other to this ValidatorResult.
bool isValid() const
Returns true if the validation was successful.
void addError(const QString &field, const QString &message)
Adds new error information to the internal QHash.
ValidatorResult()
Constructs a new ValidatorResult.
QStringList errorStrings() const
Returns a list of all error messages.
bool hasErrors(const QString &field) const
Returns true if the field has validation errors.
The Cutelyst namespace holds all public Cutelyst API.