cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatordigitsbetween.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORDIGITSBETWEEN_H
6#define CUTELYSTVALIDATORDIGITSBETWEEN_H
7
8#include "validatorrule.h"
9
10#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class ValidatorDigitsBetweenPrivate;
15
39class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDigitsBetween : public ValidatorRule
40{
41public:
57 const QVariant &min,
58 const QVariant &max,
59 const ValidatorMessages &messages = ValidatorMessages(),
60 const QString &defValKey = QString());
61
66
80 static bool validate(const QString &value, int min, int max);
81
82protected:
89 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
90
94 QString genericValidationError(Context *c,
95 const QVariant &errorData = QVariant()) const override;
96
97private:
98 Q_DECLARE_PRIVATE(ValidatorDigitsBetween) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
99 Q_DISABLE_COPY(ValidatorDigitsBetween)
100};
101
102} // namespace Cutelyst
103
104#endif // CUTELYSTVALIDATORDIGITSBETWEEN_H
The Cutelyst Context.
Definition context.h:42
Checks for digits only with a length between min and max.
Base class for all validator rules.
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.