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

◆ GetStringWithQualityLength()

static int System.Net.Http.Headers.StringWithQualityHeaderValue.GetStringWithQualityLength ( string input,
int startIndex,
out object parsedValue )
inlinestaticpackage

Definition at line 105 of file StringWithQualityHeaderValue.cs.

106 {
107 parsedValue = null;
108 if (string.IsNullOrEmpty(input) || startIndex >= input.Length)
109 {
110 return 0;
111 }
112 int tokenLength = HttpRuleParser.GetTokenLength(input, startIndex);
113 if (tokenLength == 0)
114 {
115 return 0;
116 }
117 string value = input.Substring(startIndex, tokenLength);
118 int num = startIndex + tokenLength;
119 num += HttpRuleParser.GetWhitespaceLength(input, num);
120 if (num == input.Length || input[num] != ';')
121 {
122 parsedValue = new StringWithQualityHeaderValue(value);
123 return num - startIndex;
124 }
125 num++;
126 num += HttpRuleParser.GetWhitespaceLength(input, num);
127 if (!TryReadQuality(input, out var quality, ref num))
128 {
129 return 0;
130 }
131 parsedValue = new StringWithQualityHeaderValue(value, quality);
132 return num - startIndex;
133 }
static bool TryReadQuality(string input, out double quality, ref int index)

References System.Net.Http.Headers.StringWithQualityHeaderValue.StringWithQualityHeaderValue(), System.Net.Http.HttpRuleParser.GetTokenLength(), System.Net.Http.HttpRuleParser.GetWhitespaceLength(), System.input, System.startIndex, System.Net.Http.Headers.StringWithQualityHeaderValue.TryReadQuality(), and System.value.