cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorbetween.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORBETWEEN_H
6#define CUTELYSTVALIDATORBETWEEN_H
7
8#include "validatorrule.h"
9
10#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class ValidatorBetweenPrivate;
52class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorBetween : public ValidatorRule
53{
54public:
71 ValidatorBetween(const QString &field,
72 QMetaType::Type type,
73 const QVariant &min,
74 const QVariant &max,
75 const ValidatorMessages &messages = ValidatorMessages(),
76 const QString &defValKey = QString());
77
82
83protected:
90 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
91
95 QString genericValidationError(Context *c,
96 const QVariant &errorData = QVariant()) const override;
97
101 QString genericValidationDataError(Context *c, const QVariant &errorData) const override;
102
106 QString genericParsingError(Context *c, const QVariant &errorData) const override;
107
108private:
109 Q_DECLARE_PRIVATE(ValidatorBetween) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
110 Q_DISABLE_COPY(ValidatorBetween)
111};
112
113} // namespace Cutelyst
114
115#endif // CUTELYSTVALIDATORBETWEEN_H
The Cutelyst Context.
Definition context.h:42
Checks if a value or text length is between a minimum and maximum value.
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.