cutelyst 4.3.0
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#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class ValidatorBeforePrivate;
15
96class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorBefore : public ValidatorRule
97{
98public:
111 ValidatorBefore(const QString &field,
112 const QVariant &comparison,
113 const QString &timeZone = QString(),
114 const char *inputFormat = nullptr,
115 const ValidatorMessages &messages = ValidatorMessages(),
116 const QString &defValKey = QString());
117
122
123protected:
131 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
132
136 QString genericValidationError(Context *c,
137 const QVariant &errorData = QVariant()) const override;
138
142 QString genericValidationDataError(Context *c,
143 const QVariant &errorData = QVariant()) const override;
144
148 QString genericParsingError(Context *c, const QVariant &errorData = QVariant()) const override;
149
150private:
151 Q_DECLARE_PRIVATE(ValidatorBefore) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
152 Q_DISABLE_COPY(ValidatorBefore)
153};
154
155} // namespace Cutelyst
156
157#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.