Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ProductInfoHeaderParser.cs
Go to the documentation of this file.
1
using
System.Diagnostics.CodeAnalysis
;
2
3
namespace
System.Net.Http.Headers
;
4
5
internal
sealed
class
ProductInfoHeaderParser
:
HttpHeaderParser
6
{
7
internal
static
readonly
ProductInfoHeaderParser
SingleValueParser
=
new
ProductInfoHeaderParser
(supportsMultipleValues: false);
8
9
internal
static
readonly
ProductInfoHeaderParser
MultipleValueParser
=
new
ProductInfoHeaderParser
(supportsMultipleValues: true);
10
11
private
ProductInfoHeaderParser
(
bool
supportsMultipleValues)
12
: base(supportsMultipleValues,
" "
)
13
{
14
}
15
16
public
override
bool
TryParseValue
([NotNullWhen(
true
)]
string
value
,
object
storeValue, ref
int
index
, [NotNullWhen(
true
)] out
object
parsedValue)
17
{
18
parsedValue =
null
;
19
if
(
string
.IsNullOrEmpty(
value
) ||
index
==
value
.Length)
20
{
21
return
false
;
22
}
23
int
num =
index
+
HttpRuleParser
.
GetWhitespaceLength
(
value
,
index
);
24
if
(num ==
value
.Length)
25
{
26
return
false
;
27
}
28
ProductInfoHeaderValue
parsedValue2;
29
int
productInfoLength =
ProductInfoHeaderValue
.
GetProductInfoLength
(
value
, num, out parsedValue2);
30
if
(productInfoLength == 0)
31
{
32
return
false
;
33
}
34
num += productInfoLength;
35
if
(num <
value
.Length)
36
{
37
char
c =
value
[num - 1];
38
if
(c !=
' '
&& c !=
'\t'
)
39
{
40
return
false
;
41
}
42
}
43
index
= num;
44
parsedValue = parsedValue2;
45
return
true
;
46
}
47
}
System.Net.Http.Headers.HttpHeaderParser
Definition
HttpHeaderParser.cs:8
System.Net.Http.Headers.ProductInfoHeaderParser.TryParseValue
override bool TryParseValue([NotNullWhen(true)] string value, object storeValue, ref int index, [NotNullWhen(true)] out object parsedValue)
Definition
ProductInfoHeaderParser.cs:16
System.Net.Http.Headers.ProductInfoHeaderParser.SingleValueParser
static readonly ProductInfoHeaderParser SingleValueParser
Definition
ProductInfoHeaderParser.cs:7
System.Net.Http.Headers.ProductInfoHeaderParser.MultipleValueParser
static readonly ProductInfoHeaderParser MultipleValueParser
Definition
ProductInfoHeaderParser.cs:9
System.Net.Http.Headers.ProductInfoHeaderParser.ProductInfoHeaderParser
ProductInfoHeaderParser(bool supportsMultipleValues)
Definition
ProductInfoHeaderParser.cs:11
System.Net.Http.Headers.ProductInfoHeaderParser
Definition
ProductInfoHeaderParser.cs:6
System.Net.Http.Headers.ProductInfoHeaderValue.GetProductInfoLength
static int GetProductInfoLength(string input, int startIndex, out ProductInfoHeaderValue parsedValue)
Definition
ProductInfoHeaderValue.cs:100
System.Net.Http.Headers.ProductInfoHeaderValue
Definition
ProductInfoHeaderValue.cs:7
System.Net.Http.HttpRuleParser.GetWhitespaceLength
static int GetWhitespaceLength(string input, int startIndex)
Definition
HttpRuleParser.cs:92
System.Net.Http.HttpRuleParser
Definition
HttpRuleParser.cs:6
System.Diagnostics.CodeAnalysis
Definition
AllowNullAttribute.cs:1
System.Net.Http.Headers
Definition
AltSvcHeaderParser.cs:4
System.ExceptionArgument.value
@ value
System.ExceptionArgument.index
@ index
source
System.Net.Http
System.Net.Http.Headers
ProductInfoHeaderParser.cs
Generated by
1.10.0