83 references to MailBnfHelper
System.Net.Mail (83)
System\Net\Mail\Attachment.cs (2)
136
string value =
MailBnfHelper
.ReadToken(mediaType, ref offset);
139
value =
MailBnfHelper
.ReadToken(mediaType, ref offset);
System\Net\Mail\DomainLiteralReader.cs (4)
35
Debug.Assert(data[index] ==
MailBnfHelper
.EndSquareBracket, "data did not end with a square bracket");
67
else if (data[index] ==
MailBnfHelper
.StartSquareBracket)
74
else if (!Ascii.IsValid(data[index]) || !
MailBnfHelper
.Dtext[data[index]])
98
MailBnfHelper
.EndSquareBracket));
System\Net\Mail\DotAtomReader.cs (9)
48
&& ((data[index] !=
MailBnfHelper
.Dot && !
MailBnfHelper
.Atext[data[index]])
49
|| (data[index] ==
MailBnfHelper
.Dot && index > 0 && data[index - 1] ==
MailBnfHelper
.Dot))) // Invalid char
68
else if (index > 0 && data[index] ==
MailBnfHelper
.Dot && data[index - 1] ==
MailBnfHelper
.Dot)
72
throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter,
MailBnfHelper
.ConsecutiveDots));
81
else if (data[index + 1] ==
MailBnfHelper
.Dot)
85
throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter,
MailBnfHelper
.Dot));
System\Net\Mail\MailAddressParser.cs (17)
45
Debug.Assert(index == -1 || data[index] ==
MailBnfHelper
.Comma,
85
if (data[index] ==
MailBnfHelper
.EndAngleBracket)
98
if (data[index] !=
MailBnfHelper
.At)
123
if (index >= 0 && data[index] ==
MailBnfHelper
.StartAngleBracket)
139
(index >= 0 ? data[index] :
MailBnfHelper
.EndAngleBracket)));
151
if (index >= 0 && !(expectMultipleAddresses && data[index] ==
MailBnfHelper
.Comma))
223
if (data[index] ==
MailBnfHelper
.EndSquareBracket)
285
if (data[index] ==
MailBnfHelper
.Quote)
306
MailBnfHelper
.IsAllowedWhiteSpace(data[index]) // < local@domain >
307
|| data[index] ==
MailBnfHelper
.EndComment // <(comment)local@domain>
308
|| (expectAngleBracket && data[index] ==
MailBnfHelper
.StartAngleBracket) // <local@domain>
309
|| (expectMultipleAddresses && data[index] ==
MailBnfHelper
.Comma) // local@dom,local@dom
312
|| data[index] ==
MailBnfHelper
.Quote // "display"local@domain
373
if (firstNonCommentIndex >= 0 && data[firstNonCommentIndex] ==
MailBnfHelper
.Quote)
382
Debug.Assert(data[index + 1] ==
MailBnfHelper
.Quote, $"Mis-aligned index: {index}");
396
if (index >= 0 && !(expectMultipleAddresses && data[index] ==
MailBnfHelper
.Comma))
421
Debug.Assert(index < 0 || data[index] ==
MailBnfHelper
.Comma, $"Mis-aligned index: {index}");
System\Net\Mail\MailBnfHelper.cs (4)
366
return (data[index] ==
MailBnfHelper
.CR
368
&& data[index + 1] ==
MailBnfHelper
.LF
369
&& (data[index + 2] ==
MailBnfHelper
.Space
370
|| data[index + 2] ==
MailBnfHelper
.Tab));
System\Net\Mail\MailPriority.cs (3)
156
if (value != null &&
MailBnfHelper
.HasCROrLF(value))
463
MailBnfHelper
.GetDateTimeString(DateTime.Now, null)!);
514
&& !
MailBnfHelper
.HasCROrLF(values[j])))
System\Net\Mail\QuotedPairReader.cs (4)
39
if (index <= 0 || data[index - 1] !=
MailBnfHelper
.Backslash)
85
Debug.Assert(index >= 0 && data[index] ==
MailBnfHelper
.Backslash, $"index was not a backslash: {index}");
93
} while (index >= 0 && data[index] ==
MailBnfHelper
.Backslash);
96
Debug.Assert(index < 0 || data[index] !=
MailBnfHelper
.Backslash, $"index was a backslash: {index}");
System\Net\Mail\QuotedStringFormatReader.cs (5)
40
Debug.Assert(data[index] ==
MailBnfHelper
.Quote, $"Initial char at index {index} was not a quote.");
72
else if (data[index] ==
MailBnfHelper
.Quote)
102
throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter,
MailBnfHelper
.Quote));
156
else if (expectCommaDelimiter && data[index] ==
MailBnfHelper
.Comma)
195
return
MailBnfHelper
.Qtext[ch];
System\Net\Mail\WhitespaceReader.cs (10)
42
if (data[index] ==
MailBnfHelper
.CR && expectCR)
47
else if (data[index] ==
MailBnfHelper
.CR || expectCR)
61
else if (data[index] ==
MailBnfHelper
.LF)
66
else if (data[index] ==
MailBnfHelper
.Space || data[index] ==
MailBnfHelper
.Tab)
143
else if (data[index] ==
MailBnfHelper
.EndComment)
149
else if (data[index] ==
MailBnfHelper
.StartComment)
158
MailBnfHelper
.StartComment));
170
&& (!Ascii.IsValid(data[index]) ||
MailBnfHelper
.Ctext[data[index]]))
206
throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter,
MailBnfHelper
.EndComment));
System\Net\Mime\BaseWriter.cs (3)
66
if (
MailBnfHelper
.IsFWSAt(value, index)) // At the first char of "\r\n " or "\r\n\t"
84
else if (value[index] ==
MailBnfHelper
.Space || value[index] ==
MailBnfHelper
.Tab)
System\Net\Mime\ContentDisposition.cs (9)
231
else if ((allowUnicode && !
MailBnfHelper
.HasCROrLF(value)) // Unicode without CL or LF's
234
MailBnfHelper
.GetTokenOrQuotedString(value, builder, allowUnicode);
260
_dispositionType =
MailBnfHelper
.ReadToken(_disposition, ref offset);
279
while (
MailBnfHelper
.SkipCFWS(_disposition, ref offset))
288
if (!
MailBnfHelper
.SkipCFWS(_disposition, ref offset))
293
string? paramAttribute =
MailBnfHelper
.ReadParameterAttribute(_disposition, ref offset);
302
if (!
MailBnfHelper
.SkipCFWS(_disposition, ref offset))
310
MailBnfHelper
.ReadQuotedString(_disposition, ref offset, null) :
311
MailBnfHelper
.ReadToken(_disposition, ref offset);
System\Net\Mime\ContentType.cs (12)
98
_mediaType =
MailBnfHelper
.ReadToken(value, ref offset);
102
_subType =
MailBnfHelper
.ReadToken(value, ref offset);
199
else if ((allowUnicode && !
MailBnfHelper
.HasCROrLF(value)) // Unicode without CL or LF's
202
MailBnfHelper
.GetTokenOrQuotedString(value, builder, allowUnicode);
226
_mediaType =
MailBnfHelper
.ReadToken(_type, ref offset);
232
_subType =
MailBnfHelper
.ReadToken(_type, ref offset);
238
while (
MailBnfHelper
.SkipCFWS(_type, ref offset))
245
if (!
MailBnfHelper
.SkipCFWS(_type, ref offset))
250
string? paramAttribute =
MailBnfHelper
.ReadParameterAttribute(_type, ref offset);
263
if (!
MailBnfHelper
.SkipCFWS(_type, ref offset))
269
MailBnfHelper
.ReadQuotedString(_type, ref offset, null) :
270
MailBnfHelper
.ReadToken(_type, ref offset);
System\Net\Mime\HeaderCollection.cs (1)
96
MailBnfHelper
.ValidateHeaderName(name);