MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / AddProjectFolder

Method AddProjectFolder

view/sharedcache/core/SharedCacheBuilder.cpp:80–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80size_t SharedCacheBuilder::AddProjectFolder(Ref<ProjectFolder> folder)
81{
82 auto processProjectFile = [&](const ProjectFile& file) {
83 const auto currentFilePath = file.GetPathOnDisk();
84 const auto currentFileName = file.GetName();
85
86 // Skip files not in the folder.
87 if (!IsSameFolder(file.GetFolder(), folder))
88 return false;
89
90 // Ok, we are now _sure_ that this file _might_ be a part of the cache, lets try and process it!
91 return AddFile(currentFilePath, currentFileName, CacheEntryType::Secondary);
92 };
93
94 auto viewProjectFile = m_view->GetFile()->GetProjectFile();
95 if (!viewProjectFile)
96 return 0;
97
98 auto project = viewProjectFile->GetProject();
99 size_t added = 0;
100 for (const auto& projectFile : project->GetFiles())
101 if (processProjectFile(*projectFile))
102 added++;
103 return added;
104}

Callers 1

InitControllerMethod · 0.80

Calls 8

IsSameFolderFunction · 0.85
GetPathOnDiskMethod · 0.80
GetProjectFileMethod · 0.80
GetNameMethod · 0.45
GetFolderMethod · 0.45
GetFileMethod · 0.45
GetProjectMethod · 0.45
GetFilesMethod · 0.45

Tested by

no test coverage detected