Function aliasesFileReader

Parse mime/aliases file by line ignoring empty lines and comments.

auto auto aliasesFileReader(Range) (
  Range byLine
)
if (isInputRange!Range && is(ElementType!Range : string));

Returns

Range of AliasLine tuples.

Throws

MimeFileException on parsing error.

Example

string[] lines = ["application/acrobat application/pdf", "application/ico image/vnd.microsoft.icon"];
auto expected = [AliasLine("application/acrobat", "application/pdf"), AliasLine("application/ico", "image/vnd.microsoft.icon")];
assert(equal(aliasesFileReader(lines), expected));

assertThrown!MimeFileException(aliasesFileReader(["application/aliasonly"]).array, "must throw");