cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorcharnotallowed.h
1/*
2 * SPDX-FileCopyrightText: (C) 2019-2022 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef CUTELYSTVALIDATORCHARNOTALLOWED_H
7#define CUTELYSTVALIDATORCHARNOTALLOWED_H
8
9#include "validatorrule.h"
10
11#include <Cutelyst/cutelyst_global.h>
12
13namespace Cutelyst {
14
15class ValidatorCharNotAllowedPrivate;
16
37class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorCharNotAllowed : public ValidatorRule
38{
39public:
50 const QString &forbiddenChars,
51 const ValidatorMessages &messages = ValidatorMessages(),
52 const QString &defValKey = QString());
53
57 ~ValidatorCharNotAllowed() override;
58
67 static bool
68 validate(const QString &value, const QString &forbiddenChars, QChar *foundChar = nullptr);
69
70protected:
77 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
78
82 QString genericValidationError(Context *c,
83 const QVariant &errorData = QVariant()) const override;
84
88 QString genericValidationDataError(Context *c,
89 const QVariant &errorData = QVariant()) const override;
90
91private:
92 Q_DECLARE_PRIVATE(ValidatorCharNotAllowed)
93 Q_DISABLE_COPY(ValidatorCharNotAllowed)
94};
95
96} // namespace Cutelyst
97
98#endif // CUTELYSTVALIDATORCHARNOTALLOWED_H
The Cutelyst Context.
Definition context.h:39
<Cutelyst/Plugins/Utils/validatorcharnotallowed.h>
Base class for all validator rules.
The Cutelyst namespace holds all public Cutelyst API.
Definition Mainpage.dox:8
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.