cutelyst  4.5.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorbefore.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTVALIDATORBEFORE_H
6 #define CUTELYSTVALIDATORBEFORE_H
7 
8 #include "validatorrule.h"
9 
10 namespace Cutelyst {
11 
12 class ValidatorBeforePrivate;
13 
94 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorBefore : public ValidatorRule
95 {
96 public:
109  ValidatorBefore(const QString &field,
110  const QVariant &comparison,
111  const QString &timeZone = QString(),
112  const char *inputFormat = nullptr,
113  const ValidatorMessages &messages = ValidatorMessages(),
114  const QString &defValKey = QString());
115 
119  ~ValidatorBefore() override;
120 
121 protected:
129  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
130 
134  QString genericValidationError(Context *c,
135  const QVariant &errorData = QVariant()) const override;
136 
140  QString genericValidationDataError(Context *c,
141  const QVariant &errorData = QVariant()) const override;
142 
146  QString genericParsingError(Context *c, const QVariant &errorData = QVariant()) const override;
147 
148 private:
149  Q_DECLARE_PRIVATE(ValidatorBefore) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
150  Q_DISABLE_COPY(ValidatorBefore)
151 };
152 
153 } // namespace Cutelyst
154 
155 #endif // CUTELYSTVALIDATORBEFORE_H
The Cutelyst Context.
Definition: context.h:42
Checks if a date, time or datetime is before 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