Class RangeHeader
This class encapsualtes a HTTP range
Inherited Members
Namespace:FubarDev.WebDavServer.Model.Headers
Assembly:FubarDev.WebDavServer.dll
Syntax
public class RangeHeader
Constructors
| Improve this Doc View SourceRangeHeader(String, RangeHeaderItem[])
Initializes a new instance of the RangeHeader class.
Declaration
public RangeHeader([NotNull] string unit, params RangeHeaderItem[] rangeItems)
Parameters
Type | Name | Description |
---|---|---|
String | unit | The unit of the range (currently only |
RangeHeaderItem[] | rangeItems | The HTTP range items for this range |
Properties
| Improve this Doc View SourceRangeItems
Gets the HTTP range items
Declaration
[NotNull]
public IReadOnlyCollection<RangeHeaderItem> RangeItems { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<RangeHeaderItem> |
Unit
Gets the unit for this HTTP range
Declaration
[NotNull]
public string Unit { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceNormalize(Int64)
Normalize all byte ranges using the specified totalLength
Declaration
[NotNull]
public IReadOnlyList<NormalizedRangeItem> Normalize(long totalLength)
Parameters
Type | Name | Description |
---|---|---|
Int64 | totalLength | The length of the resource |
Returns
Type | Description |
---|---|
IReadOnlyList<NormalizedRangeItem> | The list of normalized byte ranges |
Parse(IEnumerable<String>)
Parses the ranges into a new RangeHeader instance
Declaration
[NotNull]
public static RangeHeader Parse([NotNull, ItemNotNull] IEnumerable<string> ranges)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | ranges | The ranges to parse |
Returns
Type | Description |
---|---|
RangeHeader | The new RangeHeader |
Remarks
The range must be in the form unit=(range)+
Parse(String)
Parses a range into a new RangeHeader instance
Declaration
[NotNull]
public static RangeHeader Parse([NotNull] string range)
Parameters
Type | Name | Description |
---|---|---|
String | range | The range to parse |
Returns
Type | Description |
---|---|
RangeHeader | The new RangeHeader |
Remarks
The range must be in the form unit=(range)+
ToString()
Returns the textual representation of this range.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The textual representation of this range |
Overrides
Remarks
The return value of this function can be parsed using Parse(String).
ToString(RangeHeaderItem)
Returns the textual representation of a single RangeHeaderItem
Declaration
[NotNull]
public virtual string ToString(RangeHeaderItem rangeItem)
Parameters
Type | Name | Description |
---|---|---|
RangeHeaderItem | rangeItem | The RangeHeaderItem to get the textual representation for |
Returns
Type | Description |
---|---|
String | The textual representation of rangeItem |
Remarks
The return value of this function looks like unit range/length
ToString(RangeHeaderItem, Nullable<Int64>)
Returns the textual representation of a single RangeHeaderItem
Declaration
[NotNull]
public virtual string ToString(RangeHeaderItem rangeItem, long ? length)
Parameters
Type | Name | Description |
---|---|---|
RangeHeaderItem | rangeItem | The RangeHeaderItem to get the textual representation for |
Nullable<Int64> | length | The length value to be used in the textual representation |
Returns
Type | Description |
---|---|
String | The textual representation of rangeItem |
Remarks
The return value of this function looks like unit range/length