5 #ifndef CUTELYSTVALIDATOREMAIL_H
6 #define CUTELYSTVALIDATOREMAIL_H
8 #include <Cutelyst/cutelyst_global.h>
9 #include "validatorrule.h"
13 class ValidatorEmailPrivate;
61 DnsWarnNoMxRecord = 5,
65 RFC5321TLDNumberic = 10,
66 RFC5321QuotedString = 11,
67 RFC5321AddressLiteral = 12,
68 RFC5321IPv6Deprecated = 13,
73 DeprecatedLocalpart = 33,
77 DeprecatedComment = 37,
79 DeprecatedCFWSNearAt = 49,
83 RFC5322LocalTooLong = 67,
84 RFC5322DomainTooLong = 68,
85 RFC5322LabelTooLong = 69,
86 RFC5322DomainLiteral = 70,
87 RFC5322DomLitOBSDText = 71,
88 RFC5322IPv6GroupCount = 72,
89 RFC5322IPv62x2xColon = 73,
90 RFC5322IPv6BadChar = 74,
91 RFC5322IPv6MaxGroups = 75,
92 RFC5322IPv6ColonStart = 76,
93 RFC5322IPv6ColonEnd = 77,
95 ErrorExpectingDText = 129,
96 ErrorNoLocalPart = 130,
98 ErrorConsecutiveDots = 132,
99 ErrorATextAfterCFWS = 133,
100 ErrorATextAfterQS = 134,
101 ErrorATextAfterDomLit = 135,
102 ErrorExpectingQpair = 136,
103 ErrorExpectingAText = 137,
104 ErrorExpectingQText = 138,
105 ErrorExpectingCText = 139,
106 ErrorBackslashEnd = 140,
109 ErrorDomainHyphenStart = 143,
110 ErrorDomainHyphenEnd = 144,
111 ErrorUnclosedQuotedStr = 145,
112 ErrorUnclosedComment = 146,
113 ErrorUnclosedDomLiteral = 147,
114 ErrorFWSCRLFx2 = 148,
115 ErrorFWSCRLFEnd = 149,
126 AllowUTF8 = UTF8Local|AllowIDN
128 Q_DECLARE_FLAGS(Options, Option)
151 static QString diagnoseString(
Context *c, Diagnose diagnose,
const QString &label = QString());
160 static QString categoryString(
Context *c, Category category,
const QString &label = QString());
167 static Category category(Diagnose diagnose);
176 static QString categoryString(
Context *c, Diagnose diagnose,
const QString &label = QString());
187 static bool validate(
const QString &email,
Category threshold = RFC5321, Options options = NoOption, QList<Diagnose> *diagnoses =
nullptr);
202 QString genericValidationError(
Context *c,
const QVariant &errorData = QVariant())
const override;
211 Q_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.