Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryReadReverseUnQuoted()

static bool System.Net.Mail.QuotedStringFormatReader.TryReadReverseUnQuoted ( string data,
int index,
bool permitUnicode,
bool expectCommaDelimiter,
out int outIndex,
bool throwExceptionIfFail )
inlinestaticpackage

Definition at line 56 of file QuotedStringFormatReader.cs.

57 {
58 do
59 {
60 if (!WhitespaceReader.TryReadFwsReverse(data, index, out index, throwExceptionIfFail))
61 {
62 outIndex = 0;
63 return false;
64 }
65 if (index < 0)
66 {
67 break;
68 }
69 if (!QuotedPairReader.TryCountQuotedChars(data, index, permitUnicode, out var outIndex2, throwExceptionIfFail))
70 {
71 outIndex = 0;
72 return false;
73 }
74 if (outIndex2 > 0)
75 {
76 index -= outIndex2;
77 continue;
78 }
79 if (expectCommaDelimiter && data[index] == ',')
80 {
81 break;
82 }
83 if (!IsValidQtext(permitUnicode, data[index]))
84 {
85 if (throwExceptionIfFail)
86 {
87 throw new FormatException(System.SR.Format(System.SR.MailHeaderFieldInvalidCharacter, data[index]));
88 }
89 outIndex = 0;
90 return false;
91 }
92 index--;
93 }
94 while (index >= 0);
95 outIndex = index;
96 return true;
97 }
static bool IsValidQtext(bool allowUnicode, char ch)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string MailHeaderFieldInvalidCharacter
Definition SR.cs:140
Definition SR.cs:7

References System.SR.Format(), System.index, System.Net.Mail.QuotedStringFormatReader.IsValidQtext(), System.SR.MailHeaderFieldInvalidCharacter, System.Net.Mail.QuotedPairReader.TryCountQuotedChars(), and System.Net.Mail.WhitespaceReader.TryReadFwsReverse().

Referenced by System.Net.Mail.MailAddressParser.TryParseDisplayName().