Function iconsFileReader
Parse mime/icons or mime/generic-icons file by line ignoring empty lines and comments.
auto auto iconsFileReader(Range)
(
Range byLine
)
if (isInputRange!Range && is(ElementType!Range : string));
Returns
Range of IconLine
tuples.
Throws
MimeFileException
on parsing error.
Example
string[] lines = ["application/x-archive:package-x-generic", "application/x-perl:text-x-script"];
auto expected = [IconLine("application/x-archive", "package-x-generic"), IconLine("application/x-perl", "text-x-script")];
assert(equal(iconsFileReader(lines), expected));
assertThrown!MimeFileException(iconsFileReader(["application/nocolon"]) .array, "must throw");