MimeType

Represents single MIME type.

Constructors

this
this(string name)

Create MIME type with name. Name should be given in the form of media/subtype.

Members

Aliases

addPattern
deprecated alias addPattern = addGlob
Undocumented in source.
clearPatterns
deprecated alias clearPatterns = clearGlobs
Undocumented in source.
patterns
deprecated alias patterns = globs
Undocumented in source.

Functions

XMLnamespaces
const(XMLnamespace)[] XMLnamespaces()

Get XML namespaces associated with this XML-based MIME type.

addAlias
void addAlias(string alias_)

Add alias for this MIME type. Adding a duplicate does nothing.

addGlob
void addGlob(string pattern, uint weight, bool cs)
void addGlob(MimeGlob mimeGlob)

Add glob pattern for this MIME type. Adding a duplicate does nothing.

addMagic
void addMagic(MimeMagic magic)

Add magic rule.

addParent
void addParent(string parent)

Add parent type for this MIME type. Adding a duplicate does nothing.

addTreeMagic
void addTreeMagic(TreeMagic magic)

Add treemagic rule.

addXMLnamespace
void addXMLnamespace(string namespaceURI, string localName)
void addXMLnamespace(XMLnamespace namespace)

Add XML namespace.

aliases
const(string)[] aliases()

Aliases to this MIME type.

clearAliases
void clearAliases()

Remove all aliases.

clearGlobs
void clearGlobs()

Remove all glob patterns.

clearMagic
void clearMagic()

Remove all magic rules.

clearParents
void clearParents()

Remove all parents.

clearTreeMagic
void clearTreeMagic()

Remove all treemagic rules.

clearXMLnamespaces
void clearXMLnamespaces()

Remove all XML namespaces.

clone
MimeType clone()

Create MimeType deep copy.

deleteGlobs
bool deleteGlobs()

Whether to discard globs parsed from a less preferable directory. Used in merges.

deleteGlobs
bool deleteGlobs(bool clearGlobs)

Setter

deleteMagic
bool deleteMagic()

Whether to discard magic matches parsed from a less preferable directory. Used in merges.

deleteMagic
bool deleteMagic(bool clearMagic)

Setter

displayName
string displayName()

Descriptive comment of MIME type.

displayName
string displayName(string comment)

Set descriptive comment.

genericIcon
string genericIcon()

Get generic icon name. Use this if the icon could not be found.

genericIcon
string genericIcon(string iconName)

Set generic icon name.

getGenericIcon
string getGenericIcon()

Get generic icon name. The difference from genericIcon property is that this function provides default generic icon name if no explicitly set. The default form is media part of MIME type name with '-x-generic' appended. Note: This function will allocate every time it's called if no generic icon explicitly set.

getIcon
string getIcon()

Get icon name. The difference from icon property is that this function provides default icon name if no explicitly set. The default form is MIME type name with '/' replaces with '-'. Note: This function will allocate every time it's called if no icon explicitly set.

globs
const(MimeGlob)[] globs()

Array of MIME glob patterns applied to this MIME type.

icon
string icon()

Get icon name.

icon
string icon(string iconName)

Set icon name.

magics
auto magics()

Magic rules for this MIME type.

name
string name()

The name of MIME type.

name
string name(string typeName)

Set MIME type name.

parents
const(string)[] parents()

First level parents for this MIME type.

treeMagics
auto treeMagics()

Treemagic rules for this MIME type.

Meta