5#ifndef CUTELYSTVALIDATOREMAIL_H
6#define CUTELYSTVALIDATOREMAIL_H
8#include "validatorrule.h"
10#include <Cutelyst/cutelyst_global.h>
14class ValidatorEmailPrivate;
84 RFC5321QuotedString = 11,
85 RFC5321AddressLiteral = 12,
86 RFC5321IPv6Deprecated =
94 DeprecatedLocalpart = 33,
98 DeprecatedComment = 37,
100 DeprecatedCFWSNearAt =
108 RFC5322LocalTooLong = 67,
109 RFC5322DomainTooLong = 68,
110 RFC5322LabelTooLong = 69,
111 RFC5322DomainLiteral =
114 RFC5322DomLitOBSDText = 71,
117 RFC5322IPv6GroupCount =
119 RFC5322IPv62x2xColon = 73,
120 RFC5322IPv6BadChar = 74,
121 RFC5322IPv6MaxGroups = 75,
122 RFC5322IPv6ColonStart = 76,
123 RFC5322IPv6ColonEnd = 77,
125 ErrorExpectingDText =
127 ErrorNoLocalPart = 130,
129 ErrorConsecutiveDots = 132,
130 ErrorATextAfterCFWS =
132 ErrorATextAfterQS = 134,
133 ErrorATextAfterDomLit =
135 ErrorExpectingQpair =
137 ErrorExpectingAText = 137,
138 ErrorExpectingQText = 138,
139 ErrorExpectingCText = 139,
140 ErrorBackslashEnd = 140,
143 ErrorDomainHyphenStart = 143,
144 ErrorDomainHyphenEnd = 144,
145 ErrorUnclosedQuotedStr = 145,
146 ErrorUnclosedComment = 146,
147 ErrorUnclosedDomLiteral = 147,
148 ErrorFWSCRLFx2 = 148,
149 ErrorFWSCRLFEnd = 149,
162 AllowUTF8 = UTF8Local | AllowIDN
165 Q_DECLARE_FLAGS(Options, Option)
176 Category threshold = RFC5321,
177 Options options = NoOption,
179 const QString &defValKey = QString());
193 static QString diagnoseString(
Context *c, Diagnose diagnose,
const QString &label = QString());
202 static QString categoryString(
Context *c, Category category,
const QString &label = QString());
209 static Category category(Diagnose diagnose);
218 static QString categoryString(
Context *c, Diagnose diagnose,
const QString &label = QString());
232 Options options = NoOption,
233 QList<Diagnose> *diagnoses =
nullptr);
249 QString genericValidationError(
Context *c,
250 const QVariant &errorData = QVariant())
const override;
259Q_DECLARE_OPERATORS_FOR_FLAGS(Cutelyst::ValidatorEmail::Options)
Checks if the value is a valid email address according to specific RFCs.
Diagnose
Single diagnose values that show why an address is not valid.
Category
Validation category, used as threshold to define valid addresses.
Base class for all validator rules.
static bool validate(const QString &email, Category threshold=RFC5321, Options options=NoOption, QList< Diagnose > *diagnoses=nullptr)
Returns true if email is a valid address according to the Category given in the threshold.
The Cutelyst namespace holds all public Cutelyst API.
QMultiMap< QString, QString > ParamsMultiMap
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.