cutelyst  3.7.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatoralpha.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTVALIDATORALPHA_H
6 #define CUTELYSTVALIDATORALPHA_H
7 
8 #include <Cutelyst/cutelyst_global.h>
9 #include "validatorrule.h"
10 
11 namespace Cutelyst {
12 
13 class ValidatorAlphaPrivate;
14 
41 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorAlpha : public ValidatorRule
42 {
43 public:
52  ValidatorAlpha(const QString &field, bool asciiOnly = false, const ValidatorMessages &messages = ValidatorMessages(), const QString &defValKey = QString());
53 
57  ~ValidatorAlpha() override;
58 
66  static bool validate(const QString &value, bool asciiOnly = false);
67 
68 protected:
75  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
76 
80  QString genericValidationError(Context *c, const QVariant &errorData = QVariant()) const override;
81 
82 private:
83  Q_DECLARE_PRIVATE(ValidatorAlpha)
84  Q_DISABLE_COPY(ValidatorAlpha)
85 };
86 
87 }
88 
89 #endif //CUTELYSTVALIDATORALPHA_H
The Cutelyst Context.
Definition: context.h:39
Validates an input field for only alphabetic content.
Base class for all validator rules.
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:8
QMultiMap< QString, QString > ParamsMultiMap
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.
Definition: validatorrule.h:49