cutelyst 5.0.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorafter.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2025 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORAFTER_H
6#define CUTELYSTVALIDATORAFTER_H
7
8#include "validatorrule.h"
9
10namespace Cutelyst {
11
12class ValidatorAfterPrivate;
13
94class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorAfter : public ValidatorRule
95{
96public:
108 ValidatorAfter(const QString &field,
109 const QVariant &comparison,
110 const QString &timeZone = {},
111 const char *inputFormat = nullptr,
112 const ValidatorMessages &messages = ValidatorMessages(),
113 const QString &defValKey = {});
114
118 ~ValidatorAfter() override;
119
120protected:
128 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
129
140 void validateCb(Context *c, const ParamsMultiMap &params, ValidatorRtFn cb) const override;
141
145 QString genericValidationError(Context *c,
146 const QVariant &errorData = QVariant()) const override;
147
151 QString genericValidationDataError(Context *c,
152 const QVariant &errorData = QVariant()) const override;
153
157 QString genericParsingError(Context *c, const QVariant &errorData = QVariant()) const override;
158
159private:
160 Q_DECLARE_PRIVATE(ValidatorAfter) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
161 Q_DISABLE_COPY(ValidatorAfter)
162};
163
164} // namespace Cutelyst
165
166#endif // CUTELYSTVALIDATORAFTER_H
The Cutelyst Context.
Definition context.h:42
Checks if a date, time or datetime is after a comparison value.
Base class for all validator rules.
std::function< void(ValidatorReturnType &&result)> ValidatorRtFn
Void callback function for validator rules that processes the ValidatorReturnType.
QMultiMap< QString, QString > ParamsMultiMap
The Cutelyst namespace holds all public Cutelyst API.
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.