Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TransferCodingHeaderValue.cs
Go to the documentation of this file.
3using System.Text;
4
6
8{
10
11 private string _value;
12
13 public string Value => _value;
14
16
18 {
19 }
20
22 {
23 _value = source._value;
24 _parameters = source._parameters.Clone();
25 }
26
28 {
30 _value = value;
31 }
32
33 public static TransferCodingHeaderValue Parse(string? input)
34 {
35 int index = 0;
37 }
38
39 public static bool TryParse([NotNullWhen(true)] string? input, [NotNullWhen(true)] out TransferCodingHeaderValue? parsedValue)
40 {
41 int index = 0;
42 parsedValue = null;
44 {
46 return true;
47 }
48 return false;
49 }
50
52 {
53 parsedValue = null;
54 if (string.IsNullOrEmpty(input) || startIndex >= input.Length)
55 {
56 return 0;
57 }
59 if (tokenLength == 0)
60 {
61 return 0;
62 }
63 string value = input.Substring(startIndex, tokenLength);
64 int num = startIndex + tokenLength;
67 if (num < input.Length && input[num] == ';')
68 {
70 transferCodingHeaderValue._value = value;
71 num++;
73 if (nameValueListLength == 0)
74 {
75 return 0;
76 }
78 return num + nameValueListLength - startIndex;
79 }
81 transferCodingHeaderValue._value = value;
83 return num - startIndex;
84 }
85
93
94 public override bool Equals([NotNullWhen(true)] object? obj)
95 {
97 {
98 return false;
99 }
100 if (string.Equals(_value, transferCodingHeaderValue._value, StringComparison.OrdinalIgnoreCase))
101 {
102 return HeaderUtilities.AreEqualCollections(_parameters, transferCodingHeaderValue._parameters);
103 }
104 return false;
105 }
106
107 public override int GetHashCode()
108 {
110 }
111
113 {
114 return new TransferCodingHeaderValue(this);
115 }
116}
static void CheckValidToken(string value, string parameterName)
static int GetNameValueListLength(string input, int startIndex, char delimiter, ObjectCollection< NameValueHeaderValue > nameValueCollection)
static readonly TransferCodingHeaderParser SingleValueParser
static bool TryParse([NotNullWhen(true)] string? input, [NotNullWhen(true)] out TransferCodingHeaderValue? parsedValue)
static int GetTransferCodingLength(string input, int startIndex, Func< TransferCodingHeaderValue > transferCodingCreator, out TransferCodingHeaderValue parsedValue)
static TransferCodingHeaderValue Parse(string? input)
ObjectCollection< NameValueHeaderValue > _parameters
override bool Equals([NotNullWhen(true)] object? obj)
static int GetTokenLength(string input, int startIndex)
static int GetWhitespaceLength(string input, int startIndex)
static StringComparer OrdinalIgnoreCase
static string GetStringAndRelease(StringBuilder sb)
static StringBuilder Acquire(int capacity=16)