cutelyst  3.7.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatortime.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTVALIDATORTIME_H
6 #define CUTELYSTVALIDATORTIME_H
7 
8 #include <Cutelyst/cutelyst_global.h>
9 #include "validatorrule.h"
10 
11 namespace Cutelyst {
12 
13 class ValidatorTimePrivate;
14 
36 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorTime : public ValidatorRule
37 {
38 public:
46  ValidatorTime(const QString &field, const char *format = nullptr, const ValidatorMessages &messages = ValidatorMessages(), const QString &defValKey = QString());
47 
51  ~ValidatorTime() override;
52 
53 protected:
59  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
60 
64  QString genericValidationError(Context *c, const QVariant &errorData = QVariant()) const override;
65 
66 private:
67  Q_DECLARE_PRIVATE(ValidatorTime)
68  Q_DISABLE_COPY(ValidatorTime)
69 };
70 
71 }
72 
73 #endif //CUTELYSTVALIDATORTIME_H
74 
The Cutelyst Context.
Definition: context.h:39
Base class for all validator rules.
Checks if the input data is a valid time.
Definition: validatortime.h:37
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