cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorin.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORIN_H
6#define CUTELYSTVALIDATORIN_H
7
8#include "validatorrule.h"
9
10#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class ValidatorInPrivate;
15
37class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorIn : public ValidatorRule
38{
39public:
53 ValidatorIn(const QString &field,
54 const QVariant &values,
56 const ValidatorMessages &messages = ValidatorMessages(),
57 const QString &defValKey = QString());
58
62 ~ValidatorIn() override;
63
64protected:
71 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
72
76 QString genericValidationError(Context *c,
77 const QVariant &errorData = QVariant()) const override;
78
82 QString genericValidationDataError(Context *c, const QVariant &errorData) const override;
83
84private:
85 Q_DECLARE_PRIVATE(ValidatorIn) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
86 Q_DISABLE_COPY(ValidatorIn)
87};
88
89} // namespace Cutelyst
90
91#endif // CUTELYSTVALIDATORIN_H
The Cutelyst Context.
Definition context.h:42
Checks if the field value is one from a list of values.
Definition validatorin.h:38
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.