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

◆ TryReadQuotedValue()

static bool System.Net.Http.Headers.AltSvcHeaderParser.TryReadQuotedValue ( ReadOnlySpan< char > value,
out string result )
inlinestaticprivate

Definition at line 274 of file AltSvcHeaderParser.cs.

275 {
276 int num = value.IndexOf('\\');
277 if (num == -1)
278 {
279 result = ((value.Length != 0) ? new string(value) : null);
280 return true;
281 }
282 Span<char> initialBuffer = stackalloc char[128];
283 System.Text.ValueStringBuilder valueStringBuilder = new System.Text.ValueStringBuilder(initialBuffer);
284 do
285 {
286 if (num + 1 == value.Length)
287 {
288 valueStringBuilder.Dispose();
289 result = null;
290 return false;
291 }
292 if (num != 0)
293 {
294 valueStringBuilder.Append(value.Slice(0, num));
295 }
296 valueStringBuilder.Append(value[num + 1]);
297 value = value.Slice(num + 2);
298 num = value.IndexOf('\\');
299 }
300 while (num != -1);
301 if (value.Length != 0)
302 {
303 valueStringBuilder.Append(value);
304 }
305 result = valueStringBuilder.ToString();
306 return true;
307 }

References System.Text.ValueStringBuilder.Append(), System.Text.ValueStringBuilder.Dispose(), System.Text.ValueStringBuilder.ToString(), and System.value.

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