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

◆ TryReadDate()

static bool System.Net.Http.Headers.WarningHeaderValue.TryReadDate ( string input,
ref int current,
out DateTimeOffset? date )
inlinestaticprivate

Definition at line 196 of file WarningHeaderValue.cs.

197 {
198 date = null;
199 int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current);
200 current += whitespaceLength;
201 if (current < input.Length && input[current] == '"')
202 {
203 if (whitespaceLength == 0)
204 {
205 return false;
206 }
207 current++;
208 int num = current;
209 while (current < input.Length && input[current] != '"')
210 {
211 current++;
212 }
213 if (current == input.Length || current == num)
214 {
215 return false;
216 }
217 if (!HttpDateParser.TryParse(input.AsSpan(num, current - num), out var result))
218 {
219 return false;
220 }
221 date = result;
222 current++;
223 current += HttpRuleParser.GetWhitespaceLength(input, current);
224 }
225 return true;
226 }

References System.Net.Http.HttpRuleParser.GetWhitespaceLength(), System.input, and System.Net.HttpDateParser.TryParse().

Referenced by System.Net.Http.Headers.WarningHeaderValue.GetWarningLength().