Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HttpContentHeaders.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
3
namespace
System.Net.Http.Headers
;
4
5
public
sealed
class
HttpContentHeaders
:
HttpHeaders
6
{
7
private
readonly
HttpContent
_parent
;
8
9
private
bool
_contentLengthSet
;
10
11
private
HttpHeaderValueCollection<string>
_allow
;
12
13
private
HttpHeaderValueCollection<string>
_contentEncoding
;
14
15
private
HttpHeaderValueCollection<string>
_contentLanguage
;
16
17
public
ICollection<string>
Allow
18
{
19
get
20
{
21
if
(
_allow
==
null
)
22
{
23
_allow
=
new
HttpHeaderValueCollection<string>
(
KnownHeaders
.
Allow
.Descriptor,
this
,
HeaderUtilities
.
TokenValidator
);
24
}
25
return
_allow
;
26
}
27
}
28
29
public
ContentDispositionHeaderValue
?
ContentDisposition
30
{
31
get
32
{
33
return
(
ContentDispositionHeaderValue
)
GetParsedValues
(
KnownHeaders
.
ContentDisposition
.Descriptor);
34
}
35
set
36
{
37
SetOrRemoveParsedValue
(
KnownHeaders
.
ContentDisposition
.Descriptor,
value
);
38
}
39
}
40
41
public
ICollection<string>
ContentEncoding
42
{
43
get
44
{
45
if
(
_contentEncoding
==
null
)
46
{
47
_contentEncoding
=
new
HttpHeaderValueCollection<string>
(
KnownHeaders
.
ContentEncoding
.Descriptor,
this
,
HeaderUtilities
.
TokenValidator
);
48
}
49
return
_contentEncoding
;
50
}
51
}
52
53
public
ICollection<string>
ContentLanguage
54
{
55
get
56
{
57
if
(
_contentLanguage
==
null
)
58
{
59
_contentLanguage
=
new
HttpHeaderValueCollection<string>
(
KnownHeaders
.
ContentLanguage
.Descriptor,
this
,
HeaderUtilities
.
TokenValidator
);
60
}
61
return
_contentLanguage
;
62
}
63
}
64
65
public
long
?
ContentLength
66
{
67
get
68
{
69
object
parsedValues
=
GetParsedValues
(
KnownHeaders
.
ContentLength
.Descriptor);
70
if
(!
_contentLengthSet
&&
parsedValues
==
null
)
71
{
72
long
?
computedOrBufferLength
=
_parent
.
GetComputedOrBufferLength
();
73
if
(
computedOrBufferLength
.HasValue)
74
{
75
SetParsedValue
(
KnownHeaders
.
ContentLength
.Descriptor,
computedOrBufferLength
.Value);
76
}
77
return
computedOrBufferLength
;
78
}
79
if
(
parsedValues
==
null
)
80
{
81
return
null
;
82
}
83
return
(
long
)
parsedValues
;
84
}
85
set
86
{
87
SetOrRemoveParsedValue
(
KnownHeaders
.
ContentLength
.Descriptor,
value
);
88
_contentLengthSet
=
true
;
89
}
90
}
91
92
public
Uri
?
ContentLocation
93
{
94
get
95
{
96
return
(
Uri
)
GetParsedValues
(
KnownHeaders
.
ContentLocation
.Descriptor);
97
}
98
set
99
{
100
SetOrRemoveParsedValue
(
KnownHeaders
.
ContentLocation
.Descriptor,
value
);
101
}
102
}
103
104
public
byte
[]?
ContentMD5
105
{
106
get
107
{
108
return
(
byte
[])
GetParsedValues
(
KnownHeaders
.
ContentMD5
.Descriptor);
109
}
110
set
111
{
112
SetOrRemoveParsedValue
(
KnownHeaders
.
ContentMD5
.Descriptor,
value
);
113
}
114
}
115
116
public
ContentRangeHeaderValue
?
ContentRange
117
{
118
get
119
{
120
return
(
ContentRangeHeaderValue
)
GetParsedValues
(
KnownHeaders
.
ContentRange
.Descriptor);
121
}
122
set
123
{
124
SetOrRemoveParsedValue
(
KnownHeaders
.
ContentRange
.Descriptor,
value
);
125
}
126
}
127
128
public
MediaTypeHeaderValue
?
ContentType
129
{
130
get
131
{
132
return
(
MediaTypeHeaderValue
)
GetParsedValues
(
KnownHeaders
.
ContentType
.Descriptor);
133
}
134
set
135
{
136
SetOrRemoveParsedValue
(
KnownHeaders
.
ContentType
.Descriptor,
value
);
137
}
138
}
139
140
public
DateTimeOffset
?
Expires
141
{
142
get
143
{
144
return
HeaderUtilities
.
GetDateTimeOffsetValue
(
KnownHeaders
.
Expires
.Descriptor,
this
,
DateTimeOffset
.
MinValue
);
145
}
146
set
147
{
148
SetOrRemoveParsedValue
(
KnownHeaders
.
Expires
.Descriptor,
value
);
149
}
150
}
151
152
public
DateTimeOffset
?
LastModified
153
{
154
get
155
{
156
return
HeaderUtilities
.
GetDateTimeOffsetValue
(
KnownHeaders
.
LastModified
.Descriptor,
this
);
157
}
158
set
159
{
160
SetOrRemoveParsedValue
(
KnownHeaders
.
LastModified
.Descriptor,
value
);
161
}
162
}
163
164
internal
HttpContentHeaders
(
HttpContent
parent)
165
:
base
(
HttpHeaderType
.Content |
HttpHeaderType
.
Custom
,
HttpHeaderType
.
None
)
166
{
167
_parent
= parent;
168
}
169
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Net.Http.Headers.ContentDispositionHeaderValue
Definition
ContentDispositionHeaderValue.cs:9
System.Net.Http.Headers.ContentRangeHeaderValue
Definition
ContentRangeHeaderValue.cs:7
System.Net.Http.Headers.HeaderUtilities.TokenValidator
static readonly Action< HttpHeaderValueCollection< string >, string > TokenValidator
Definition
HeaderUtilities.cs:14
System.Net.Http.Headers.HeaderUtilities.GetDateTimeOffsetValue
static ? DateTimeOffset GetDateTimeOffsetValue(HeaderDescriptor descriptor, HttpHeaders store, DateTimeOffset? defaultValue=null)
Definition
HeaderUtilities.cs:216
System.Net.Http.Headers.HeaderUtilities
Definition
HeaderUtilities.cs:9
System.Net.Http.Headers.HttpContentHeaders._parent
readonly HttpContent _parent
Definition
HttpContentHeaders.cs:7
System.Net.Http.Headers.HttpContentHeaders._contentLanguage
HttpHeaderValueCollection< string > _contentLanguage
Definition
HttpContentHeaders.cs:15
System.Net.Http.Headers.HttpContentHeaders.ContentType
MediaTypeHeaderValue? ContentType
Definition
HttpContentHeaders.cs:129
System.Net.Http.Headers.HttpContentHeaders.Expires
DateTimeOffset? Expires
Definition
HttpContentHeaders.cs:141
System.Net.Http.Headers.HttpContentHeaders.ContentEncoding
ICollection< string > ContentEncoding
Definition
HttpContentHeaders.cs:42
System.Net.Http.Headers.HttpContentHeaders.ContentRange
ContentRangeHeaderValue? ContentRange
Definition
HttpContentHeaders.cs:117
System.Net.Http.Headers.HttpContentHeaders.HttpContentHeaders
HttpContentHeaders(HttpContent parent)
Definition
HttpContentHeaders.cs:164
System.Net.Http.Headers.HttpContentHeaders.ContentMD5
byte?[] ContentMD5
Definition
HttpContentHeaders.cs:105
System.Net.Http.Headers.HttpContentHeaders._contentEncoding
HttpHeaderValueCollection< string > _contentEncoding
Definition
HttpContentHeaders.cs:13
System.Net.Http.Headers.HttpContentHeaders.ContentLength
long? ContentLength
Definition
HttpContentHeaders.cs:66
System.Net.Http.Headers.HttpContentHeaders.ContentLocation
Uri? ContentLocation
Definition
HttpContentHeaders.cs:93
System.Net.Http.Headers.HttpContentHeaders._contentLengthSet
bool _contentLengthSet
Definition
HttpContentHeaders.cs:9
System.Net.Http.Headers.HttpContentHeaders.ContentDisposition
ContentDispositionHeaderValue? ContentDisposition
Definition
HttpContentHeaders.cs:30
System.Net.Http.Headers.HttpContentHeaders.ContentLanguage
ICollection< string > ContentLanguage
Definition
HttpContentHeaders.cs:54
System.Net.Http.Headers.HttpContentHeaders.Allow
ICollection< string > Allow
Definition
HttpContentHeaders.cs:18
System.Net.Http.Headers.HttpContentHeaders._allow
HttpHeaderValueCollection< string > _allow
Definition
HttpContentHeaders.cs:11
System.Net.Http.Headers.HttpContentHeaders.LastModified
DateTimeOffset? LastModified
Definition
HttpContentHeaders.cs:153
System.Net.Http.Headers.HttpContentHeaders
Definition
HttpContentHeaders.cs:6
System.Net.Http.Headers.HttpHeaders.SetParsedValue
void SetParsedValue(HeaderDescriptor descriptor, object value)
Definition
HttpHeaders.cs:345
System.Net.Http.Headers.HttpHeaders.SetOrRemoveParsedValue
void SetOrRemoveParsedValue(HeaderDescriptor descriptor, object value)
Definition
HttpHeaders.cs:354
System.Net.Http.Headers.HttpHeaders.GetParsedValues
object GetParsedValues(HeaderDescriptor descriptor)
Definition
HttpHeaders.cs:779
System.Net.Http.Headers.HttpHeaders
Definition
HttpHeaders.cs:11
System.Net.Http.Headers.KnownHeaders.ContentLanguage
static readonly KnownHeader ContentLanguage
Definition
KnownHeaders.cs:89
System.Net.Http.Headers.KnownHeaders.LastModified
static readonly KnownHeader LastModified
Definition
KnownHeaders.cs:139
System.Net.Http.Headers.KnownHeaders.ContentRange
static readonly KnownHeader ContentRange
Definition
KnownHeaders.cs:97
System.Net.Http.Headers.KnownHeaders.ContentDisposition
static readonly KnownHeader ContentDisposition
Definition
KnownHeaders.cs:85
System.Net.Http.Headers.KnownHeaders.ContentType
static readonly KnownHeader ContentType
Definition
KnownHeaders.cs:101
System.Net.Http.Headers.KnownHeaders.ContentLength
static readonly KnownHeader ContentLength
Definition
KnownHeaders.cs:91
System.Net.Http.Headers.KnownHeaders.ContentLocation
static readonly KnownHeader ContentLocation
Definition
KnownHeaders.cs:93
System.Net.Http.Headers.KnownHeaders.ContentMD5
static readonly KnownHeader ContentMD5
Definition
KnownHeaders.cs:95
System.Net.Http.Headers.KnownHeaders.ContentEncoding
static readonly KnownHeader ContentEncoding
Definition
KnownHeaders.cs:87
System.Net.Http.Headers.KnownHeaders.Allow
static readonly KnownHeader Allow
Definition
KnownHeaders.cs:73
System.Net.Http.Headers.KnownHeaders.Expires
static readonly KnownHeader Expires
Definition
KnownHeaders.cs:115
System.Net.Http.Headers.KnownHeaders
Definition
KnownHeaders.cs:6
System.Net.Http.Headers.MediaTypeHeaderValue
Definition
MediaTypeHeaderValue.cs:9
System.Net.Http.HttpContent.GetComputedOrBufferLength
long? GetComputedOrBufferLength()
Definition
HttpContent.cs:646
System.Net.Http.HttpContent
Definition
HttpContent.cs:13
System.Uri
Definition
Uri.cs:16
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Net.Http.Headers.HttpHeaderType
HttpHeaderType
Definition
HttpHeaderType.cs:5
System.Net.Http.Headers.HttpHeaderType.None
@ None
System.Net.Http.Headers.HttpHeaderType.Custom
@ Custom
System.Net.Http.Headers
Definition
AltSvcHeaderParser.cs:4
System.ExceptionArgument.value
@ value
System.DateTimeOffset.MinValue
static readonly DateTimeOffset MinValue
Definition
DateTimeOffset.cs:15
System.DateTimeOffset
Definition
DateTimeOffset.cs:14
source
System.Net.Http
System.Net.Http.Headers
HttpContentHeaders.cs
Generated by
1.10.0