cutelyst  4.4.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 namespace Cutelyst {
11 
12 class ValidatorDifferentPrivate;
13 
36 class CUTELYST_PLUGIN_UTILS_VALIDATOR_EXPORT ValidatorDifferent : public ValidatorRule
37 {
38 public:
48  ValidatorDifferent(const QString &field,
49  const QString &other,
50  const char *otherLabel = nullptr,
51  const ValidatorMessages &messages = ValidatorMessages());
52 
56  ~ValidatorDifferent() override;
57 
58 protected:
65  ValidatorReturnType validate(Context *c, const ParamsMultiMap &params) const override;
66 
70  QString genericValidationError(Context *c,
71  const QVariant &errorData = QVariant()) const override;
72 
73 private:
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
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.
Definition: validatorrule.h:49