Function namespacesFileReader

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

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

Returns

Range of NamespaceLine tuples.

Throws

MimeFileException on parsing error.

Example

string[] lines = ["http://www.w3.org/1999/xhtml html application/xhtml+xml", "http://www.w3.org/2000/svg svg image/svg+xml"];
auto expected = [NamespaceLine("http://www.w3.org/1999/xhtml", "html", "application/xhtml+xml"), NamespaceLine("http://www.w3.org/2000/svg", "svg", "image/svg+xml")];
assert(equal(namespacesFileReader(lines), expected));

assertThrown!MimeFileException(namespacesFileReader(["http://www.example.org nameonly"]).array, "must throw");
assertThrown!MimeFileException(namespacesFileReader(["http://www.example.org"]).array, "must throw");