/// <summary> /// 比较内存对象文件搜索器 /// </summary> /// <param name="other"></param> public void Cmp(pathSearcher other) { foreach (KeyValuePair <string, HashSet <string> > value in Paths) { HashSet <string> count; if (other.Paths.TryGetValue(value.Key, out count)) { if (value.Value.Count > count.Count) { Console.WriteLine(value.Key + " = " + count.Count.toString() + " + " + (value.Value.Count - count.Count).toString()); foreach (string path in value.Value) { if (!count.Contains(path)) { Console.WriteLine(path); } } } } else { Console.WriteLine(value.Key + " + " + value.Value.Count.toString() + @" " + value.Value.joinString(@" ")); } } }
/// <summary> /// 比较内存对象文件搜索器 /// </summary> /// <param name="file1"></param> /// <param name="file2"></param> public static void CmpPath(string file1, string file2) { pathSearcher search2 = new pathSearcher(file2), search1 = new pathSearcher(file1); search2.Cmp(search1); }