5 #ifndef CUTELYSTVALIDATOREMAIL_H 6 #define CUTELYSTVALIDATOREMAIL_H 8 #include "validatorrule.h" 12 class ValidatorEmailPrivate;
78 RFC5321QuotedString = 11,
79 RFC5321AddressLiteral = 12,
80 RFC5321IPv6Deprecated =
88 DeprecatedLocalpart = 33,
92 DeprecatedComment = 37,
94 DeprecatedCFWSNearAt =
102 RFC5322LocalTooLong = 67,
103 RFC5322DomainTooLong = 68,
104 RFC5322LabelTooLong = 69,
105 RFC5322DomainLiteral =
108 RFC5322DomLitOBSDText = 71,
111 RFC5322IPv6GroupCount =
113 RFC5322IPv62x2xColon = 73,
114 RFC5322IPv6BadChar = 74,
115 RFC5322IPv6MaxGroups = 75,
116 RFC5322IPv6ColonStart = 76,
117 RFC5322IPv6ColonEnd = 77,
119 ErrorExpectingDText =
121 ErrorNoLocalPart = 130,
123 ErrorConsecutiveDots = 132,
124 ErrorATextAfterCFWS =
126 ErrorATextAfterQS = 134,
127 ErrorATextAfterDomLit =
129 ErrorExpectingQpair =
131 ErrorExpectingAText = 137,
132 ErrorExpectingQText = 138,
133 ErrorExpectingCText = 139,
134 ErrorBackslashEnd = 140,
137 ErrorDomainHyphenStart = 143,
138 ErrorDomainHyphenEnd = 144,
139 ErrorUnclosedQuotedStr = 145,
140 ErrorUnclosedComment = 146,
141 ErrorUnclosedDomLiteral = 147,
142 ErrorFWSCRLFx2 = 148,
143 ErrorFWSCRLFEnd = 149,
161 RFC5321 = CFWSComment,
164 CFWS = DeprecatedLocalpart,
166 Deprecated = RFC5322Domain,
168 RFC5322 = ErrorExpectingDText,
182 AllowUTF8 = UTF8Local | AllowIDN
185 Q_DECLARE_FLAGS(Options, Option)
197 Category threshold = RFC5321,
198 Options options = NoOption,
200 const QString &defValKey = {});
205 ~ValidatorEmail()
override;
214 static QString diagnoseString(
const Context *c, Diagnose diagnose,
const QString &label = {});
223 static QString categoryString(
const Context *c, Category category,
const QString &label = {});
230 static Category category(Diagnose diagnose);
240 static QString categoryString(
const Context *c, Diagnose diagnose,
const QString &label = {});
257 static bool validate(
const QString &email,
258 Category threshold = RFC5321,
259 Options options = NoOption,
276 static void validateCb(
295 ValidatorReturnType validate(Context *c,
const ParamsMultiMap ¶ms)
const override;
308 void validateCb(Context *c,
const ParamsMultiMap ¶ms, ValidatorRtFn cb)
const override;
313 QString genericValidationError(Context *c,
317 Q_DECLARE_PRIVATE(ValidatorEmail)
318 Q_DISABLE_COPY(ValidatorEmail)
323 Q_DECLARE_OPERATORS_FOR_FLAGS(Cutelyst::ValidatorEmail::Options)
325 #endif // CUTELYSTVALIDATOREMAIL_H Stores custom error messages and the input field label.
Checks if the value is a valid email address according to specific RFCs.
The Cutelyst namespace holds all public Cutelyst API.
Base class for all validator rules.
QMultiMap< QString, QString > ParamsMultiMap
Category
Validation category, used as threshold to define valid addresses.
Diagnose
Single diagnose values that show why an address is not valid.