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