5#ifndef CUTELYSTVALIDATORRESULT_H
6#define CUTELYSTVALIDATORRESULT_H
8#include <Cutelyst/Plugins/Utils/validator_export.h>
9#include <Cutelyst/context.h>
15#include <QSharedDataPointer>
18#include <QVariantHash>
22class ValidatorResultPrivate;
117 [[nodiscard]]
bool isValid() const noexcept;
156 [[nodiscard]]
bool hasErrors(const
QString &field) const noexcept;
168 [[nodiscard]]
QJsonObject errorsJsonObject() const;
181 explicit operator
bool() const noexcept {
return isValid(); }
194 [[nodiscard]] QVariantHash values() const noexcept;
226 [[nodiscard]] QVariantHash extras() const noexcept;
262 bool await_ready()
const noexcept {
return m_hasResult; }
264 bool await_suspend(std::coroutine_handle<> h)
noexcept
270 QString(), QStringLiteral(
"Internal Server Error: the context was destroyed."));
276 return !await_ready();
304 std::coroutine_handle<> m_handle;
305 bool m_hasResult{
false};
Coroutine awaitable for ValidatorResult.
Provides information about performed validations.
ValidatorResult & operator=(const ValidatorResult &other) noexcept
ValidatorResult(const ValidatorResult &other) noexcept
ValidatorResult & operator=(ValidatorResult &&other) noexcept
ValidatorResult(ValidatorResult &&other) noexcept
~ValidatorResult() noexcept
Validation processor for input data.
The Cutelyst namespace holds all public Cutelyst API.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)