Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ProductInfoHeaderParser.cs
Go to the documentation of this file.
2
4
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 }
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}
override bool TryParseValue([NotNullWhen(true)] string value, object storeValue, ref int index, [NotNullWhen(true)] out object parsedValue)
static readonly ProductInfoHeaderParser SingleValueParser
static readonly ProductInfoHeaderParser MultipleValueParser
static int GetProductInfoLength(string input, int startIndex, out ProductInfoHeaderValue parsedValue)
static int GetWhitespaceLength(string input, int startIndex)