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