cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatordatetime.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORDATETIME_H
6#define CUTELYSTVALIDATORDATETIME_H
7
8#include "validatorrule.h"
9
10#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class ValidatorDateTimePrivate;
15
51class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDateTime : public ValidatorRule
52{
53public:
65 ValidatorDateTime(const QString &field,
66 const QString &timeZone,
67 const char *inputFormat = nullptr,
68 const ValidatorMessages &messages = ValidatorMessages(),
69 const QString &defValKey = QString());
70
75
76protected:
83 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
84
88 QString genericValidationError(Context *c,
89 const QVariant &errorData = QVariant()) const override;
90
91private:
92 Q_DECLARE_PRIVATE(ValidatorDateTime) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
93 Q_DISABLE_COPY(ValidatorDateTime)
94};
95
96} // namespace Cutelyst
97
98#endif // CUTELYSTVALIDATORDATETIME_H
The Cutelyst Context.
Definition context.h:42
Checks if the input data is a valid datetime.
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.