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

◆ GetNameValueLength() [1/2]

static int System.Net.Http.Headers.NameValueHeaderValue.GetNameValueLength ( string input,
int startIndex,
Func< NameValueHeaderValue > nameValueCreator,
out NameValueHeaderValue parsedValue )
inlinestaticpackageinherited

Definition at line 165 of file NameValueHeaderValue.cs.

166 {
167 parsedValue = null;
168 if (string.IsNullOrEmpty(input) || startIndex >= input.Length)
169 {
170 return 0;
171 }
172 int tokenLength = HttpRuleParser.GetTokenLength(input, startIndex);
173 if (tokenLength == 0)
174 {
175 return 0;
176 }
177 string name = input.Substring(startIndex, tokenLength);
178 int num = startIndex + tokenLength;
179 num += HttpRuleParser.GetWhitespaceLength(input, num);
180 if (num == input.Length || input[num] != '=')
181 {
182 parsedValue = nameValueCreator();
183 parsedValue._name = name;
184 num += HttpRuleParser.GetWhitespaceLength(input, num);
185 return num - startIndex;
186 }
187 num++;
188 num += HttpRuleParser.GetWhitespaceLength(input, num);
189 int valueLength = GetValueLength(input, num);
190 if (valueLength == 0)
191 {
192 return 0;
193 }
194 parsedValue = nameValueCreator();
195 parsedValue._name = name;
196 parsedValue._value = input.Substring(num, valueLength);
197 num += valueLength;
198 num += HttpRuleParser.GetWhitespaceLength(input, num);
199 return num - startIndex;
200 }
static int GetValueLength(string input, int startIndex)

References System.Net.Http.HttpRuleParser.GetTokenLength(), System.Net.Http.Headers.NameValueHeaderValue.GetValueLength(), System.Net.Http.HttpRuleParser.GetWhitespaceLength(), System.input, and System.startIndex.