cutelyst  3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorrequiredwithall.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTVALIDATORREQUIREDWITHALL_H
6 #define CUTELYSTVALIDATORREQUIREDWITHALL_H
7 
8 #include "validatorrule.h"
9 
10 #include <Cutelyst/cutelyst_global.h>
11 
12 #include <QStringList>
13 
14 namespace Cutelyst {
15 
16 class ValidatorRequiredWithAllPrivate;
17 
38 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorRequiredWithAll : public ValidatorRule
39 {
40 public:
47  ValidatorRequiredWithAll(const QString &field,
48  const QStringList &otherFields,
49  const ValidatorMessages &messages = ValidatorMessages());
50 
54  ~ValidatorRequiredWithAll() override;
55 
56 protected:
63  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
64 
68  QString genericValidationError(Context *c,
69  const QVariant &errorData = QVariant()) const override;
70 
71 private:
72  Q_DECLARE_PRIVATE(ValidatorRequiredWithAll)
73  Q_DISABLE_COPY(ValidatorRequiredWithAll)
74 };
75 
76 } // namespace Cutelyst
77 
78 #endif // CUTELYSTVALIDATORREQUIREDWITHALL_H
Stores custom error messages and the input field label.
<Cutelyst/Plugins/Utils/validatorrequiredwithall.h>
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