cutelyst 5.0.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-2025 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
10namespace Cutelyst {
11
12class ValidatorDateTimePrivate;
13
49class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDateTime : public ValidatorRule
50{
51public:
63 explicit ValidatorDateTime(const QString &field,
64 const QString &timeZone,
65 const char *inputFormat = nullptr,
66 const ValidatorMessages &messages = {},
67 const QString &defValKey = {});
68
73
74protected:
81 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
82
92 void validateCb(Context *c, const ParamsMultiMap &params, ValidatorRtFn cb) const override;
93
97 QString genericValidationError(Context *c,
98 const QVariant &errorData = QVariant()) const override;
99
100private:
101 Q_DECLARE_PRIVATE(ValidatorDateTime) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
102 Q_DISABLE_COPY(ValidatorDateTime)
103};
104
105} // namespace Cutelyst
106
107#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.
std::function< void(ValidatorReturnType &&result)> ValidatorRtFn
Void callback function for validator rules that processes the ValidatorReturnType.
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.