18 #ifndef CUTELYSTVALIDATORRULE_H
19 #define CUTELYSTVALIDATORRULE_H
21 #include <Cutelyst/cutelyst_global.h>
22 #include <Cutelyst/paramsmultimap.h>
24 #include <QScopedPointer>
26 #include <QLoggingCategory>
28 Q_DECLARE_LOGGING_CATEGORY(C_VALIDATOR)
72 explicit operator bool()
const {
73 return errorMessage.
isNull();
82 return errorMessage.isNull();
157 ValidatorMessages(
const char *customLabel,
const char *customValidationError =
nullptr,
const char *customParsingError =
nullptr,
const char *customValidationDataError =
nullptr) :
159 validationError(customValidationError),
160 parsingError(customParsingError),
161 validationDataError(customValidationDataError)
163 const char *label =
nullptr;
164 const char *validationError =
nullptr;
165 const char *parsingError =
nullptr;
166 const char *validationDataError =
nullptr;
169 class ValidatorRulePrivate;
384 bool trimBefore()
const;
549 void setTrimBefore(
bool trimBefore);
552 friend class ValidatorPrivate;
557 #endif //CUTELYSTVALIDATORRULE_H
ValidatorMessages()
Constructs a default ValidatorMessages object with all custom messages disabled.
Stores custom error messages and the input field label.
Base class for all validator rules.
Validation processor for input data.
Contains the result of a single input parameter validation.
bool isValid() const
Returns true if validation succeeded.
ValidatorMessages(const char *customLabel, const char *customValidationError=nullptr, const char *customParsingError=nullptr, const char *customValidationDataError=nullptr)
Constructs a new ValidatorMessages object with the given parameters.