cutelyst  3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatorrequiredunlessstash.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2018-2022 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef CUTELYSTVALIDATORREQUIREDUNLESSSTASH_H
7 #define CUTELYSTVALIDATORREQUIREDUNLESSSTASH_H
8 
9 #include "validatorrule.h"
10 
11 #include <Cutelyst/cutelyst_global.h>
12 
13 namespace Cutelyst {
14 
15 class ValidatorRequiredUnlessStashPrivate;
16 
39 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorRequiredUnlessStash : public ValidatorRule
40 {
41 public:
51  const QString &stashKey,
52  const QVariantList &stashValues,
53  const ValidatorMessages &messages = ValidatorMessages());
54 
58  ~ValidatorRequiredUnlessStash() override;
59 
60 protected:
67  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
68 
72  QString genericValidationError(Context *c,
73  const QVariant &errorData = QVariant()) const override;
74 
75 private:
76  Q_DECLARE_PRIVATE(ValidatorRequiredUnlessStash)
77  Q_DISABLE_COPY(ValidatorRequiredUnlessStash)
78 };
79 
80 } // namespace Cutelyst
81 
82 #endif // CUTELYSTVALIDATORREQUIREDUNLESSSTASH_H
Stores custom error messages and the input field label.
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.
<Cutelyst/Plugins/Utils/validatorrequiredunlessstash.h>
Contains the result of a single input parameter validation.
Definition: validatorrule.h:49