5 #ifndef CUTELYSTVALIDATOREMAIL_H 6 #define CUTELYSTVALIDATOREMAIL_H 8 #include "validatorrule.h" 10 #include <Cutelyst/cutelyst_global.h> 14 class ValidatorEmailPrivate;
90 RFC5321QuotedString = 11,
91 RFC5321AddressLiteral = 12,
92 RFC5321IPv6Deprecated =
100 DeprecatedLocalpart = 33,
102 DeprecatedQText = 35,
104 DeprecatedComment = 37,
105 DeprecatedCText = 38,
106 DeprecatedCFWSNearAt =
114 RFC5322LocalTooLong = 67,
115 RFC5322DomainTooLong = 68,
116 RFC5322LabelTooLong = 69,
117 RFC5322DomainLiteral =
120 RFC5322DomLitOBSDText = 71,
123 RFC5322IPv6GroupCount =
125 RFC5322IPv62x2xColon = 73,
126 RFC5322IPv6BadChar = 74,
127 RFC5322IPv6MaxGroups = 75,
128 RFC5322IPv6ColonStart = 76,
129 RFC5322IPv6ColonEnd = 77,
131 ErrorExpectingDText =
133 ErrorNoLocalPart = 130,
135 ErrorConsecutiveDots = 132,
136 ErrorATextAfterCFWS =
138 ErrorATextAfterQS = 134,
139 ErrorATextAfterDomLit =
141 ErrorExpectingQpair =
143 ErrorExpectingAText = 137,
144 ErrorExpectingQText = 138,
145 ErrorExpectingCText = 139,
146 ErrorBackslashEnd = 140,
149 ErrorDomainHyphenStart = 143,
150 ErrorDomainHyphenEnd = 144,
151 ErrorUnclosedQuotedStr = 145,
152 ErrorUnclosedComment = 146,
153 ErrorUnclosedDomLiteral = 147,
154 ErrorFWSCRLFx2 = 148,
155 ErrorFWSCRLFEnd = 149,
168 AllowUTF8 = UTF8Local | AllowIDN
171 Q_DECLARE_FLAGS(Options, Option)
183 Category threshold = RFC5321,
184 Options options = NoOption,
209 static QString categoryString(Context *c, Category category,
const QString &label = {});
216 static Category category(Diagnose diagnose);
226 static QString categoryString(Context *c, Diagnose diagnose,
const QString &label = {});
241 static bool validate(
const QString &email,
242 Category threshold = RFC5321,
243 Options options = NoOption,
255 ValidatorReturnType validate(Context *c,
const ParamsMultiMap ¶ms)
const override;
260 QString genericValidationError(Context *c,
264 Q_DECLARE_PRIVATE(ValidatorEmail)
265 Q_DISABLE_COPY(ValidatorEmail)
270 Q_DECLARE_OPERATORS_FOR_FLAGS(Cutelyst::ValidatorEmail::Options)
272 #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.