cutelyst  3.7.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorinteger.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTVALIDATORINTEGER_H
6 #define CUTELYSTVALIDATORINTEGER_H
7 
8 #include <Cutelyst/cutelyst_global.h>
9 #include "validatorrule.h"
10 
11 namespace Cutelyst {
12 
13 class ValidatorIntegerPrivate;
14 
34 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorInteger : public ValidatorRule
35 {
36 public:
44  ValidatorInteger(const QString &field, QMetaType::Type type = QMetaType::ULongLong, const ValidatorMessages &messages = ValidatorMessages(), const QString &defValKey = QString());
45 
49  ~ValidatorInteger() override;
50 
51 protected:
58  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
59 
63  QString genericValidationError(Context *c, const QVariant &errorData = QVariant()) const override;
64 
65 private:
66  Q_DECLARE_PRIVATE(ValidatorInteger)
67  Q_DISABLE_COPY(ValidatorInteger)
68 };
69 
70 }
71 
72 #endif //CUTELYSTVALIDATORINTEGER_H
73 
The Cutelyst Context.
Definition: context.h:39
Checks if the value is an integer.
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