treeMatchTypeFromString

Get symbolic constant of tree match type according to the string.

@nogc @safe pure nothrow
TreeMatch.Type
treeMatchTypeFromString
(
const(char)[] str
)

Return Value

Type: TreeMatch.Type

mime.treemagic.TreeMatch.Type for passed string, or mime.treemagic.TreeMatch.Type.any if type name is unknown.

Examples

assert(treeMatchTypeFromString("file") == TreeMatch.Type.file);
assert(treeMatchTypeFromString("directory") == TreeMatch.Type.directory);
assert(treeMatchTypeFromString("link") == TreeMatch.Type.link);
assert(treeMatchTypeFromString("") == TreeMatch.Type.any);

Meta