public override void LoadReport(StreamReader src, FileInfo fi) { _Timestamp = fi.LastWriteTimeUtc; _total = 0; string line = src.ReadLine(); while (src.EndOfStream == false) { string t = src.ReadLine(); DuplicateFileInfo entry = new DuplicateFileInfo(t); _total += entry.Length; if (entry.Length > 0) { _dupes.Add(entry.Group, entry); _dupes[entry.Group][0].Parse(entry); if (entry.Length > _largest) { _largest = entry.Length; } } else { _zero.Add(entry); } } _unique = _dupes.Values.Sum(g => g.First().Length); BuildIndexes(_bypath, _byname, _tree); }
internal void Parse(DuplicateFileInfo entry) { if (this != entry) { string[] folders1 = this.FoldersInPath; string[] folders2 = entry.FoldersInPath; int p1 = folders1.GetUpperBound(0); int p2 = folders2.GetUpperBound(0); while (p1 >= 0 && p2 >= 0 && folders1[p1] == folders2[p2]) { p1--; p2--; } if (this.Path == null) { for (int p = 0; p <= p1; p++) { _path += pathsep + folders1[p]; } if (this.Path != null) { _fileName = this.FullPath.Substring(Path.Length); } } for (int p = 0; p <= p2; p++) { entry.Path += pathsep + folders2[p]; } if (entry.Path != null) { entry.FileName = entry.FullPath.Substring(entry.Path.Length); } } }