mime.files.common.MimeFileException on parsing error.
string[] lines = [ "#comment", "50:text/x-c++src:*.cpp", "60:text/x-c++src:*.C:cs", "50:text/x-csrc:*.c:cs" ]; auto expected = [GlobLine(50, "text/x-c++src", "*.cpp", false), GlobLine(60, "text/x-c++src", "*.C", true), GlobLine(50, "text/x-csrc", "*.c", true)]; assert(equal(globs2FileReader(lines), expected)); assertThrown!MimeFileException(globs2FileReader(["notanumber:text/plain:*.txt"]).array, "must throw"); MimeFileException mfe; try { globs2FileReader(["notanumber:text/nopattern"]).array; } catch(MimeFileException e) { mfe = e; assert(mfe.lineString == "notanumber:text/nopattern"); } assert(mfe, "must throw");
Parse mime/globs2 file by line ignoring empty lines and comments.