cutelyst 5.0.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-2025 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORTIME_H
6#define CUTELYSTVALIDATORTIME_H
7
8#include "validatorrule.h"
9
10namespace Cutelyst {
11
12class ValidatorTimePrivate;
13
41class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorTime : public ValidatorRule
42{
43public:
53 explicit ValidatorTime(const QString &field,
54 const char *format = nullptr,
55 const ValidatorMessages &messages = {},
56 const QString &defValKey = {});
57
61 ~ValidatorTime() override;
62
63protected:
70 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
71
81 void validateCb(Context *c, const ParamsMultiMap &params, ValidatorRtFn cb) const override;
82
86 QString genericValidationError(Context *c,
87 const QVariant &errorData = QVariant()) const override;
88
89private:
90 Q_DECLARE_PRIVATE(ValidatorTime) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
91 Q_DISABLE_COPY(ValidatorTime)
92};
93
94} // namespace Cutelyst
95
96#endif // CUTELYSTVALIDATORTIME_H
The Cutelyst Context.
Definition context.h:42
Base class for all validator rules.
std::function< void(ValidatorReturnType &&result)> ValidatorRtFn
Void callback function for validator rules that processes the ValidatorReturnType.
Checks if the input data is a valid time.
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.