5#ifndef CUTELYSTVALIDATOREMAIL_H
6#define CUTELYSTVALIDATOREMAIL_H
8#include "validatorrule.h"
12class ValidatorEmailPrivate;
88 RFC5321QuotedString = 11,
89 RFC5321AddressLiteral = 12,
90 RFC5321IPv6Deprecated =
98 DeprecatedLocalpart = 33,
100 DeprecatedQText = 35,
102 DeprecatedComment = 37,
103 DeprecatedCText = 38,
104 DeprecatedCFWSNearAt =
112 RFC5322LocalTooLong = 67,
113 RFC5322DomainTooLong = 68,
114 RFC5322LabelTooLong = 69,
115 RFC5322DomainLiteral =
118 RFC5322DomLitOBSDText = 71,
121 RFC5322IPv6GroupCount =
123 RFC5322IPv62x2xColon = 73,
124 RFC5322IPv6BadChar = 74,
125 RFC5322IPv6MaxGroups = 75,
126 RFC5322IPv6ColonStart = 76,
127 RFC5322IPv6ColonEnd = 77,
129 ErrorExpectingDText =
131 ErrorNoLocalPart = 130,
133 ErrorConsecutiveDots = 132,
134 ErrorATextAfterCFWS =
136 ErrorATextAfterQS = 134,
137 ErrorATextAfterDomLit =
139 ErrorExpectingQpair =
141 ErrorExpectingAText = 137,
142 ErrorExpectingQText = 138,
143 ErrorExpectingCText = 139,
144 ErrorBackslashEnd = 140,
147 ErrorDomainHyphenStart = 143,
148 ErrorDomainHyphenEnd = 144,
149 ErrorUnclosedQuotedStr = 145,
150 ErrorUnclosedComment = 146,
151 ErrorUnclosedDomLiteral = 147,
152 ErrorFWSCRLFx2 = 148,
153 ErrorFWSCRLFEnd = 149,
166 AllowUTF8 = UTF8Local | AllowIDN
169 Q_DECLARE_FLAGS(Options, Option)
181 Category threshold = RFC5321,
182 Options options = NoOption,
184 const QString &defValKey = QString());
198 static QString diagnoseString(
Context *c,
Diagnose diagnose,
const QString &label = {});
207 static QString categoryString(
Context *c, Category category,
const QString &label = {});
214 static Category category(Diagnose diagnose);
224 static QString categoryString(Context *c, Diagnose diagnose,
const QString &label = {});
241 Options options = NoOption,
242 QList<Diagnose> *diagnoses =
nullptr);
258 QString genericValidationError(
Context *c,
259 const QVariant &errorData = QVariant())
const override;
268Q_DECLARE_OPERATORS_FOR_FLAGS(Cutelyst::ValidatorEmail::Options)
Checks if the value is a valid email address according to specific RFCs.
Category
Validation category, used as threshold to define valid addresses.
~ValidatorEmail() override
Diagnose
Single diagnose values that show why an address is not valid.
Base class for all validator rules.
QMultiMap< QString, QString > ParamsMultiMap
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.
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.