matchTypeFromString

Get symbolic constant of match type according to the string.

@nogc @safe pure nothrow
MagicMatch.Type
matchTypeFromString
(
const(char)[] str
)

Return Value

Type: MagicMatch.Type

mime.magic.MagicMatch.Type for passed string, or mime.magic.MagicMatch.Type.string_ if type name is unknown.

Examples

assert(matchTypeFromString("string") == MagicMatch.Type.string_);
assert(matchTypeFromString("little32") == MagicMatch.Type.little32);
assert(matchTypeFromString("byte") == MagicMatch.Type.byte_);
assert(matchTypeFromString("") == MagicMatch.Type.string_);

Meta