cutelyst  4.5.1
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-2023 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 
12 namespace Cutelyst {
13 
14 class ValidatorNotInPrivate;
15 
37 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorNotIn : public ValidatorRule
38 {
39 public:
52  ValidatorNotIn(const QString &field,
53  const QVariant &values,
55  const ValidatorMessages &messages = ValidatorMessages(),
56  const QString &defValKey = QString());
57 
61  ~ValidatorNotIn() override;
62 
63 protected:
70  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
71 
75  QString genericValidationError(Context *c,
76  const QVariant &errorData = QVariant()) const override;
77 
81  QString genericValidationDataError(Context *c, const QVariant &errorData) const override;
82 
83 private:
84  Q_DECLARE_PRIVATE(ValidatorNotIn) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
85  Q_DISABLE_COPY(ValidatorNotIn)
86 };
87 
88 } // namespace Cutelyst
89 
90 #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.
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.
Definition: validatorrule.h:49