public HashSet <string> GetMethodBodyDependences(Metadata.DB_Type type) { Metadata.Model model = new Metadata.Model(new FileFinder(project.dependence_dir)); Metadata.MyCppMethodBodyTypeFinder f = new Metadata.MyCppMethodBodyTypeFinder(model); model.AcceptTypeVisitor(f, type); HashSet <string> set = new HashSet <string>(); foreach (var s in f.typeRef) { if (s.IsVoid) { continue; } if (s.isGenericParameter) { continue; } set.Add(s.GetTypeDefinitionFullName()); foreach (var l in GetTypeList(s)) { set.Add(l); } } return(set); }
//返回一个类型的不可以声明的类型 public HashSet <string> GetTypeDependencesNoDeclareType(Metadata.DB_Type type) { HashSet <string> set = new HashSet <string>(); Metadata.Model model = new Metadata.Model(new FileFinder(project.dependence_dir)); MyCppHeaderTypeNoDeclareFinder f = new MyCppHeaderTypeNoDeclareFinder(model); model.AcceptTypeVisitor(f, type); //泛型需要添加方法体 if (type.is_generic_type_definition) { set = GetMethodBodyDependences(type); } foreach (var s in f.result) { if (s.IsVoid) { continue; } if (s.isGenericParameter) { continue; } set.Add(s.GetTypeDefinitionFullName()); foreach (var l in GetTypeList(s)) { set.Add(l); } } return(set); }