MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / getFileInfo

Method getFileInfo

radiantcore/vfs/Doom3FileSystem.cpp:182–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182FileInfo Doom3FileSystem::getFileInfo(const std::string& vfsRelativePath)
183{
184 for (const auto& descriptor : _archives)
185 {
186 if (!descriptor.archive->containsFile(vfsRelativePath))
187 {
188 continue;
189 }
190
191 // Determine the visibility of this file
192 auto topLevelDir = os::getToplevelDirectory(vfsRelativePath);
193
194 auto visibility = Visibility::NORMAL;
195 auto assetsList = findAssetsList(topLevelDir);
196
197 if (assetsList)
198 {
199 // Information in the assets list file are relative to the top-level dir
200 auto relativePath = os::getRelativePath(vfsRelativePath, topLevelDir);
201 visibility = assetsList->getVisibility(relativePath);
202 }
203
204 return FileInfo("", vfsRelativePath, visibility, *descriptor.archive);
205 }
206
207 return FileInfo();
208}
209
210ArchiveFilePtr Doom3FileSystem::openFile(const std::string& filename)
211{

Callers 2

TEST_FFunction · 0.80
saveDeclarationMethod · 0.80

Calls 5

getToplevelDirectoryFunction · 0.85
getRelativePathFunction · 0.85
FileInfoClass · 0.50
containsFileMethod · 0.45
getVisibilityMethod · 0.45

Tested by

no test coverage detected