cutelyst 5.0.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatornotin.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2025 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORNOTIN_H
6#define CUTELYSTVALIDATORNOTIN_H
7
8#include "validatorrule.h"
9
10#include <QStringList>
11
12namespace Cutelyst {
13
14class ValidatorNotInPrivate;
15
37class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorNotIn : public ValidatorRule
38{
39public:
52 ValidatorNotIn(const QString &field,
53 const QVariant &values,
55 const ValidatorMessages &messages = ValidatorMessages(),
56 const QString &defValKey = {});
57
61 ~ValidatorNotIn() 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
92 QString genericValidationDataError(Context *c, const QVariant &errorData) const override;
93
94private:
95 Q_DECLARE_PRIVATE(ValidatorNotIn) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
96 Q_DISABLE_COPY(ValidatorNotIn)
97};
98
99} // namespace Cutelyst
100
101#endif // CUTELYSTVALIDATORNOTIN_H
The Cutelyst Context.
Definition context.h:42
Checks if the field value is not one from a list of values.
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.
CaseSensitivity
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.