cutelyst  3.7.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-2022 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTVALIDATORDIFFERENT_H
6 #define CUTELYSTVALIDATORDIFFERENT_H
7 
8 #include <Cutelyst/cutelyst_global.h>
9 #include "validatorrule.h"
10 
11 namespace Cutelyst {
12 
13 class ValidatorDifferentPrivate;
14 
32 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDifferent : public ValidatorRule
33 {
34 public:
42  ValidatorDifferent(const QString &field, const QString &other, const char *otherLabel = nullptr, const ValidatorMessages &messages = ValidatorMessages());
43 
47  ~ValidatorDifferent() override;
48 
49 protected:
55  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
56 
60  QString genericValidationError(Context *c, const QVariant &errorData = QVariant()) const override;
61 
62 private:
63  Q_DECLARE_PRIVATE(ValidatorDifferent)
64  Q_DISABLE_COPY(ValidatorDifferent)
65 };
66 
67 }
68 
69 #endif //CUTELYSTVALIDATORDIFFERENT_H
70 
The Cutelyst Context.
Definition: context.h:39
Checks if two values are different.
Base class for all validator rules.
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:8
QMultiMap< QString, QString > ParamsMultiMap
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.
Definition: validatorrule.h:49