cutelyst  4.5.1
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-2023 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 
10 namespace Cutelyst {
11 
12 class ValidatorAfterPrivate;
13 
94 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorAfter : public ValidatorRule
95 {
96 public:
108  ValidatorAfter(const QString &field,
109  const QVariant &comparison,
110  const QString &timeZone = QString(),
111  const char *inputFormat = nullptr,
112  const ValidatorMessages &messages = ValidatorMessages(),
113  const QString &defValKey = QString());
114 
118  ~ValidatorAfter() override;
119 
120 protected:
128  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
129 
133  QString genericValidationError(Context *c,
134  const QVariant &errorData = QVariant()) const override;
135 
139  QString genericValidationDataError(Context *c,
140  const QVariant &errorData = QVariant()) const override;
141 
145  QString genericParsingError(Context *c, const QVariant &errorData = QVariant()) const override;
146 
147 private:
148  Q_DECLARE_PRIVATE(ValidatorAfter) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
149  Q_DISABLE_COPY(ValidatorAfter)
150 };
151 
152 } // namespace Cutelyst
153 
154 #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.
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.
Definition: validatorrule.h:49