cutelyst  3.7.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-2022 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTVALIDATORDATETIME_H
6 #define CUTELYSTVALIDATORDATETIME_H
7 
8 #include <Cutelyst/cutelyst_global.h>
9 #include "validatorrule.h"
10 
11 namespace Cutelyst {
12 
13 class ValidatorDateTimePrivate;
14 
42 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDateTime : public ValidatorRule
43 {
44 public:
53  ValidatorDateTime(const QString &field, const QString &timeZone, const char *inputFormat = nullptr, const ValidatorMessages &messages = ValidatorMessages(), const QString &defValKey = QString());
54 
58  ~ValidatorDateTime() override;
59 
60 protected:
66  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
67 
71  QString genericValidationError(Context *c, const QVariant &errorData = QVariant()) const override;
72 
73 private:
74  Q_DECLARE_PRIVATE(ValidatorDateTime)
75  Q_DISABLE_COPY(ValidatorDateTime)
76 };
77 
78 }
79 
80 #endif //CUTELYSTVALIDATORDATETIME_H
81 
The Cutelyst Context.
Definition: context.h:39
Checks if the input data is a valid datetime.
Base class for all validator rules.
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:8
QMultiMap< QString, QString > ParamsMultiMap
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.
Definition: validatorrule.h:49