небольшие правки с инклудами
This commit is contained in:
@@ -9,7 +9,8 @@ import _VisualDVM.ProjectData.Files.LanguageStyle;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.FileInfo;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Include;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Json.FileIncludesJson;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Json.IncludesJson;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
@@ -30,12 +31,21 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
target.includes_root.removeAllChildren();
|
||||
target.allIncludes.clear();
|
||||
for (DBProjectFile file : target.db.files.Data.values())
|
||||
file.relativeHeaders.clear();
|
||||
file.dependencies.clear();
|
||||
}
|
||||
@Override
|
||||
public void unpack(String packed) throws Exception {
|
||||
// IncludesJson includesJson = Utils_.gson.fromJson(packed, IncludesJson.class);
|
||||
// System.out.println("packed="+packed);
|
||||
/*
|
||||
IncludesJson includesJson = Utils_.gson.fromJson(packed, IncludesJson.class);
|
||||
System.out.println("packed="+packed);
|
||||
for (FileIncludesJson fileIncludesJson : includesJson.allIncludes) {
|
||||
String file_name = Utils_.toW(fileIncludesJson.file);
|
||||
DBProjectFile dbProjectFile = target.db.files.get(file_name);
|
||||
for (Include include : fileIncludesJson.includes)
|
||||
dbProjectFile.dependencies.add(include.dependencyFileName);
|
||||
}
|
||||
*/
|
||||
//--
|
||||
update_current = false;
|
||||
FileInfo fileInfo = null;
|
||||
String[] data_ = packed.split("@");
|
||||
@@ -56,16 +66,18 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
if (!target.addictedFiles.containsKey(fileInfo.file))
|
||||
target.addictedFiles.put(fileInfo.file, fileInfo);
|
||||
//-------------------------------------
|
||||
String file_name = data__[j];
|
||||
if (target.db.files.containsKey(file_name)) {
|
||||
DBProjectFile d_file = target.db.files.Data.get(file_name);
|
||||
String include_name = data__[j];
|
||||
if (target.db.files.containsKey(include_name)) {
|
||||
DBProjectFile d_file = target.db.files.Data.get(include_name);
|
||||
//----------------->>
|
||||
if (!target.allIncludes.containsKey(d_file.name))
|
||||
target.allIncludes.put(d_file.name, d_file);
|
||||
//----------------->>
|
||||
//--
|
||||
DBProjectFile father = target.db.files.Data.get(fileInfo.file);
|
||||
father.relativeHeaders.put(Utils.getRelativeName(father.file.getParentFile(), d_file.file), d_file);
|
||||
// if (d_file.fileType == FileType.none)
|
||||
if (!father.dependencies.contains(include_name))
|
||||
father.dependencies.add(include_name);
|
||||
//--
|
||||
d_file.UpdateType(FileType.header);
|
||||
if (d_file.languageName == LanguageName.n)
|
||||
d_file.UpdateLanguage(father.languageName);
|
||||
|
||||
Reference in New Issue
Block a user