cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatoralphanum.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORALPHANUM_H
6#define CUTELYSTVALIDATORALPHANUM_H
7
8#include "validatorrule.h"
9
10#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class ValidatorAlphaNumPrivate;
15
46class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorAlphaNum : public ValidatorRule
47{
48public:
58 ValidatorAlphaNum(const QString &field,
59 bool asciiOnly = false,
60 const ValidatorMessages &messages = ValidatorMessages(),
61 const QString &defValKey = QString());
62
67
75 static bool validate(const QString &value, bool asciiOnly = false);
76
77protected:
84 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
85
89 QString genericValidationError(Context *c,
90 const QVariant &errorData = QVariant()) const override;
91
92private:
93 Q_DECLARE_PRIVATE(ValidatorAlphaNum) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
94 Q_DISABLE_COPY(ValidatorAlphaNum)
95};
96
97} // namespace Cutelyst
98
99#endif // CUTELYSTVALIDATORALPHANUM_H
The Cutelyst Context.
Definition context.h:42
Checks a value for only alpha-numeric content.
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.