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

◆ TryReadTokenOrQuotedInt32()

static bool System.Net.Http.Headers.AltSvcHeaderParser.TryReadTokenOrQuotedInt32 ( string value,
int startIndex,
out int result,
out int readLength )
inlinestaticprivate

Definition at line 309 of file AltSvcHeaderParser.cs.

310 {
311 if (startIndex >= value.Length)
312 {
313 result = 0;
314 readLength = 0;
315 return false;
316 }
317 if (HttpRuleParser.IsTokenChar(value[startIndex]))
318 {
319 return HeaderUtilities.TryParseInt32(value, startIndex, readLength = HttpRuleParser.GetTokenLength(value, startIndex), out result);
320 }
321 if (HttpRuleParser.GetQuotedStringLength(value, startIndex, out var length) == HttpParseResult.Parsed)
322 {
323 readLength = length;
324 return TryReadQuotedInt32Value(value.AsSpan(1, length - 2), out result);
325 }
326 result = 0;
327 readLength = 0;
328 return false;
329 }
static bool TryReadQuotedInt32Value(ReadOnlySpan< char > value, out int result)

References System.Net.Http.HttpRuleParser.GetQuotedStringLength(), System.Net.Http.HttpRuleParser.GetTokenLength(), System.Net.Http.HttpRuleParser.IsTokenChar(), System.length, System.startIndex, System.Net.Http.Headers.HeaderUtilities.TryParseInt32(), System.Net.Http.Headers.AltSvcHeaderParser.TryReadQuotedInt32Value(), and System.value.

Referenced by System.Net.Http.Headers.AltSvcHeaderParser.GetParsedValueLength().