cutelyst 4.8.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
validatordifferent.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTVALIDATORDIFFERENT_H
6#define CUTELYSTVALIDATORDIFFERENT_H
7
8#include "validatorrule.h"
9
10namespace Cutelyst {
11
12class ValidatorDifferentPrivate;
13
36class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDifferent : public ValidatorRule
37{
38public:
49 const QString &other,
50 const char *otherLabel = nullptr,
51 const ValidatorMessages &messages = ValidatorMessages());
52
57
58protected:
65 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
66
71 const QVariant &errorData = QVariant()) const override;
72
73private:
74 Q_DECLARE_PRIVATE(ValidatorDifferent) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
75 Q_DISABLE_COPY(ValidatorDifferent)
76};
77
78} // namespace Cutelyst
79
80#endif // CUTELYSTVALIDATORDIFFERENT_H
The Cutelyst Context.
Definition context.h:42
ValidatorDifferent(const QString &field, const QString &other, const char *otherLabel=nullptr, const ValidatorMessages &messages=ValidatorMessages())
ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override
QString genericValidationError(Context *c, const QVariant &errorData=QVariant()) const override
QString field() const noexcept
ValidatorRule(const QString &field, const ValidatorMessages &messages={}, const QString &defValKey={}, QByteArrayView validatorName=nullptr)
QMultiMap< QString, QString > ParamsMultiMap
The Cutelyst namespace holds all public Cutelyst API.
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.