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

◆ ParseAndAddValue()

void System.Net.Http.Headers.HttpHeaders.ParseAndAddValue ( HeaderDescriptor descriptor,
HeaderStoreItemInfo info,
string value )
inlineprivateinherited

Definition at line 807 of file HttpHeaders.cs.

808 {
809 if (descriptor.Parser == null)
810 {
812 AddParsedValue(info, value ?? string.Empty);
813 return;
814 }
815 if (!info.CanAddParsedValue(descriptor.Parser))
816 {
817 throw new FormatException(System.SR.Format(CultureInfo.InvariantCulture, System.SR.net_http_headers_single_value_header, descriptor.Name));
818 }
819 int index = 0;
820 object obj = descriptor.Parser.ParseValue(value, info.ParsedValue, ref index);
821 if (value == null || index == value.Length)
822 {
823 if (obj != null)
824 {
826 }
827 return;
828 }
830 if (obj != null)
831 {
832 list.Add(obj);
833 }
834 while (index < value.Length)
835 {
836 obj = descriptor.Parser.ParseValue(value, info.ParsedValue, ref index);
837 if (obj != null)
838 {
839 list.Add(obj);
840 }
841 }
842 foreach (object item in list)
843 {
845 }
846 }
static CultureInfo InvariantCulture
static void CheckContainsNewLine(string value)
void AddParsedValue(HeaderDescriptor descriptor, object value)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_http_headers_single_value_header
Definition SR.cs:22
Definition SR.cs:7

References System.Net.Http.Headers.HttpHeaders.AddParsedValue(), System.Net.Http.Headers.HttpHeaders.CheckContainsNewLine(), System.SR.Format(), System.index, System.info, System.Globalization.CultureInfo.InvariantCulture, System.item, System.list, System.Net.Http.Headers.HeaderDescriptor.Name, System.SR.net_http_headers_single_value_header, System.obj, System.Net.Http.Headers.HeaderDescriptor.Parser, System.Net.Http.Headers.HttpHeaderParser.ParseValue(), and System.value.

Referenced by System.Net.Http.Headers.HttpHeaders.Add(), and System.Net.Http.Headers.HttpHeaders.Add().