C# Класс Tp.Utils.Mime.MimeType

Defines a Mime Content Type
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddExtension void
AddMagic void
HasCtrlOrSpecials bool
HasMagic bool
Init void
IsValid bool
Matches bool

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Clean() публичный статический Метод

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. ///
Результат string

Equals() публичный Метод

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. ///
Результат bool

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

Matches() публичный Метод

public Matches ( string url ) : bool
url string
Результат bool

MimeType() публичный Метод

Creates a MimeType from a string.
public MimeType ( string name ) : System
name string the MIME content type string. ///
Результат System

MimeType() публичный Метод

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. ///
Результат System

ToString() публичный Метод

public ToString ( ) : string
Результат string