mime.common

Common functions and constants to work with MIME types.

Members

Functions

defaultGenericIconName
string defaultGenericIconName(string mimeType)

Default generic icon for MIME type.

defaultIconName
string defaultIconName(string mimeType)

Default icon for MIME type.

implicitParent
string implicitParent(const(char)[] mimeType)

Get implicit parent type if mimeType. This is text/plain for all text/* types and application/octet-stream for all streamable types.

isNoGlobs
bool isNoGlobs(const(T)[] pattern)

Check is pattern is __NOGLOBS__. This means glob patterns from the less preferable MIME paths should be ignored.

isNoMagic
bool isNoMagic(const(T)[] value)

Check if value is __NOMAGIC__. This means magic rules from the less preferable MIME paths should be ignored.

isValidMimeTypeName
bool isValidMimeTypeName(const(char)[] name)

Check if name is valid MIME type name.

parseMimeTypeName
auto parseMimeTypeName(String name)

Parse MIME type name into pair of media and subtype strings.

Manifest constants

dataSizeToRead
enum dataSizeToRead;
Undocumented in source.

Variables

defaultGlobWeight
enum uint defaultGlobWeight;

Default glob pattern weight to use when it's not explicitly provided.

defaultMatchWeight
enum uint defaultMatchWeight;

Default magic rule priority to use when it's not explicitly provided.

maximumGlobWeight
enum uint maximumGlobWeight;

Maximum glob pattern weight as defined by spec.

maximumMatchWeight
enum uint maximumMatchWeight;

Maximum magic rule priority as defined by spec.

Meta