cutelyst  3.9.1
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 "validatorrule.h"
9 
10 #include <Cutelyst/cutelyst_global.h>
11 
12 namespace Cutelyst {
13 
14 class ValidatorAlphaPrivate;
15 
44 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorAlpha : public ValidatorRule
45 {
46 public:
56  ValidatorAlpha(const QString &field,
57  bool asciiOnly = false,
58  const ValidatorMessages &messages = ValidatorMessages(),
59  const QString &defValKey = QString());
60 
64  ~ValidatorAlpha() override;
65 
73  static bool validate(const QString &value, bool asciiOnly = false);
74 
75 protected:
82  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
83 
87  QString genericValidationError(Context *c,
88  const QVariant &errorData = QVariant()) const override;
89 
90 private:
91  Q_DECLARE_PRIVATE(ValidatorAlpha)
92  Q_DISABLE_COPY(ValidatorAlpha)
93 };
94 
95 } // namespace Cutelyst
96 
97 #endif // CUTELYSTVALIDATORALPHA_H
Stores custom error messages and the input field label.
Validates an input field for only alphabetic content.
The Cutelyst Context.
Definition: context.h:38
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Base class for all validator rules.
Contains the result of a single input parameter validation.
Definition: validatorrule.h:49