cutelyst 4.3.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
10#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class ValidatorDifferentPrivate;
15
38class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDifferent : public ValidatorRule
39{
40public:
50 ValidatorDifferent(const QString &field,
51 const QString &other,
52 const char *otherLabel = nullptr,
53 const ValidatorMessages &messages = ValidatorMessages());
54
59
60protected:
67 ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
68
72 QString genericValidationError(Context *c,
73 const QVariant &errorData = QVariant()) const override;
74
75private:
76 Q_DECLARE_PRIVATE(ValidatorDifferent) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
77 Q_DISABLE_COPY(ValidatorDifferent)
78};
79
80} // namespace Cutelyst
81
82#endif // CUTELYSTVALIDATORDIFFERENT_H
The Cutelyst Context.
Definition context.h:42
Checks if two values are different.
Base class for all validator rules.
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.