protected override ArrayList GenerateSFVFileList(string file) { ArrayList ret = new ArrayList (); TextReader reader = File.OpenText (file); string linea; linea = reader.ReadLine (); while (linea != null){ int idx = linea.IndexOf (';'); if (idx >=0) linea = linea.Substring (0, linea.IndexOf(';')); linea = linea.Trim(); if (linea != string.Empty){ try{ string fname = linea.Substring (linea.IndexOf ("(")+1, linea.LastIndexOf(')')-5).Trim(); string hash = linea.Substring (linea.LastIndexOf(" ")).Trim(); fname = fname.Replace ('/', Path.DirectorySeparatorChar); SFVElement el = new SFVElement (fname, hash, new FileHasherMd5()); ret.Add (el); } catch (System.Exception){ } } linea = reader.ReadLine (); } return ret; }
protected override void PutMd5(SFVElement e, TextWriter writer) { writer.WriteLine ("MD5 ({0}) = {1}", e.FileName, e.RealHash); }