cutelyst  3.9.1
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 "validatorrule.h"
9 
10 #include <Cutelyst/cutelyst_global.h>
11 
12 namespace Cutelyst {
13 
14 class ValidatorDateTimePrivate;
15 
48 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDateTime : public ValidatorRule
49 {
50 public:
60  ValidatorDateTime(const QString &field,
61  const QString &timeZone,
62  const char *inputFormat = nullptr,
63  const ValidatorMessages &messages = ValidatorMessages(),
64  const QString &defValKey = QString());
65 
69  ~ValidatorDateTime() override;
70 
71 protected:
78  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
79 
83  QString genericValidationError(Context *c,
84  const QVariant &errorData = QVariant()) const override;
85 
86 private:
87  Q_DECLARE_PRIVATE(ValidatorDateTime)
88  Q_DISABLE_COPY(ValidatorDateTime)
89 };
90 
91 } // namespace Cutelyst
92 
93 #endif // CUTELYSTVALIDATORDATETIME_H
Checks if the input data is a valid datetime.
Stores custom error messages and the input field label.
The Cutelyst Context.
Definition: context.h:38
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Base class for all validator rules.
Contains the result of a single input parameter validation.
Definition: validatorrule.h:49