cutelyst 5.0.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatormin.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2025 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORMIN_H
6#define CUTELYSTVALIDATORMIN_H
7
8#include "validatorrule.h"
9
10namespace Cutelyst {
11
12class ValidatorMinPrivate;
13
46class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorMin : public ValidatorRule
47{
48public:
60 ValidatorMin(const QString &field,
61 QMetaType::Type type,
62 const QVariant &min,
63 const ValidatorMessages &messages = ValidatorMessages(),
64 const QString &defValKey = {});
65
69 ~ValidatorMin() override;
70
71protected:
78 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
79
89 void validateCb(Context *c, const ParamsMultiMap &params, ValidatorRtFn cb) const override;
90
94 QString genericValidationError(Context *c,
95 const QVariant &errorData = QVariant()) const override;
96
100 QString genericValidationDataError(Context *c, const QVariant &errorData) const override;
101
105 QString genericParsingError(Context *c, const QVariant &errorData) const override;
106
107private:
108 Q_DECLARE_PRIVATE(ValidatorMin) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
109 Q_DISABLE_COPY(ValidatorMin)
110};
111
112} // namespace Cutelyst
113
114#endif // CUTELYSTVALIDATORMIN_H
The Cutelyst Context.
Definition context.h:42
Checks if a value is not smaller or shorter than a maximum value.
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.