Class MimeTypeSelector
Selector used in selecting which MIME type to use.
Inheritance
System.Object
MimeTypeSelector
Implements
System.IComparable<MimeTypeSelector>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: VDS.RDF
Assembly: dotNetRDF.dll
Syntax
public sealed class MimeTypeSelector : IComparable<MimeTypeSelector>
Constructors
| Improve this Doc View SourceMimeTypeSelector(String, String, Double, Int32)
Creates a new MIME Type Selector.
Declaration
public MimeTypeSelector(string type, string charset, double quality, int order)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | MIME Type to match. |
System.String | charset | Charset. |
System.Double | quality | Quality (in range 0.0-1.0). |
System.Int32 | order | Order of appearance (used as precendence tiebreaker where necessary). |
Properties
| Improve this Doc View SourceCharset
Gets the Charset for the selector (may be null if none specified).
Declaration
public string Charset { get; }
Property Value
Type | Description |
---|---|
System.String |
IsAny
Gets whether the selector if for a */* pattern i.e. accept any.
Declaration
public bool IsAny { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsInvalid
Gets whether the selector is invalid.
Declaration
public bool IsInvalid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsRange
Gets whether the selector is for a type/* pattern i.e. accept any sub-type of the given type.
Declaration
public bool IsRange { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSpecific
Gets whether the selector is for a specific MIME type e.g. type/sub-type.
Declaration
public bool IsSpecific { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Order
Gets the order of apperance for the selector (used as precedence tiebreaker where necessary).
Declaration
public int Order { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Quality
Gets the quality for the selector (range of 0.0-1.0).
Declaration
public double Quality { get; }
Property Value
Type | Description |
---|---|
System.Double |
RangeType
Gets the range type if this is a range selector.
Declaration
public string RangeType { get; }
Property Value
Type | Description |
---|---|
System.String | A type string of the form type/ if this is a range selector, otherwise null. |
Type
Gets the selected type.
Declaration
public string Type { get; }
Property Value
Type | Description |
---|---|
System.String | A type string of the form type/subtype assuming the type if valid. |
Methods
| Improve this Doc View SourceCompareTo(MimeTypeSelector)
Sorts the selector in precedence order according to the content negotiation rules from the relevant RFCs.
Declaration
public int CompareTo(MimeTypeSelector other)
Parameters
Type | Name | Description |
---|---|---|
MimeTypeSelector | other | Selector to compare against. |
Returns
Type | Description |
---|---|
System.Int32 |
Create(String, Int32)
Creates a MIME Type selector.
Declaration
public static MimeTypeSelector Create(string contentType, int order)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | MIME Type. |
System.Int32 | order | Order the selector appears in the input. |
Returns
Type | Description |
---|---|
MimeTypeSelector |
CreateSelectors(IEnumerable<String>)
Creates an enumeration of MIME type selectors.
Declaration
public static IEnumerable<MimeTypeSelector> CreateSelectors(IEnumerable<string> ctypes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | ctypes | MIME Types. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MimeTypeSelector> |
ToString()
Gets the string representation of the selector as it would appear in an Accept header.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
Remarks
Unless this is an invalid selector this will always be a valid selector that could be appended to a MIME type header.
Implements
System.IComparable<T>