C# Class Tp.Utils.Mime.MimeType

Defines a Mime Content Type
Mostrar archivo Open project: TargetProcess/Target-Process-Plugins Class Usage Examples

Private Properties

Property Type Description
AddExtension void
AddMagic void
HasCtrlOrSpecials bool
HasMagic bool
Init void
IsValid bool
Matches bool

Public Methods

Method Description
Clean ( string type ) : string

Cleans a content-type. This method cleans a content-type by removing its optional parameters and returning only its primary-type/sub-type.

parsing/cleaning of the specified type.

Equals ( Object obj ) : bool

Indicates if an object is equal to this mime-type. The specified object is equal to this mime-type if it is not null, and it is an instance of MimeType and its name is equals to this mime-type.

GetHashCode ( ) : int

Matches ( string url ) : bool
MimeType ( string name ) : System

Creates a MimeType from a string.

MimeType ( string primary, string sub ) : System

Creates a MimeType with the given primary type and sub type.

ToString ( ) : string

Private Methods

Method Description
AddExtension ( string ext ) : void

Add a supported extension.

AddMagic ( int offset, string type, string magic ) : void
HasCtrlOrSpecials ( string type ) : bool

Checks if the specified string contains some special characters.

HasMagic ( ) : bool
Init ( string primary, string sub ) : void

Init method used by constructors.

IsValid ( string type ) : bool

Checks if the specified primary or sub type is valid.

Matches ( byte data ) : bool

Method Details

Clean() public static method

Cleans a content-type. This method cleans a content-type by removing its optional parameters and returning only its primary-type/sub-type. parsing/cleaning of the specified type.
public static Clean ( string type ) : string
type string is the content-type to clean. ///
return string

Equals() public method

Indicates if an object is equal to this mime-type. The specified object is equal to this mime-type if it is not null, and it is an instance of MimeType and its name is equals to this mime-type.
public Equals ( Object obj ) : bool
obj Object the reference object with which to compare. ///
return bool

GetHashCode() public method

public GetHashCode ( ) : int
return int

Matches() public method

public Matches ( string url ) : bool
url string
return bool

MimeType() public method

Creates a MimeType from a string.
public MimeType ( string name ) : System
name string the MIME content type string. ///
return System

MimeType() public method

Creates a MimeType with the given primary type and sub type.
public MimeType ( string primary, string sub ) : System
primary string the content type primary type. ///
sub string the content type sub type. ///
return System

ToString() public method

public ToString ( ) : string
return string