mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-25 08:14:45 +02:00
Add "GetFileInfoByHandle" function to (many) file systems
This commit is contained in:
@@ -162,7 +162,7 @@ static bool RealPath(const std::string ¤tDirectory, const std::string &inP
|
||||
return true;
|
||||
}
|
||||
|
||||
IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle)
|
||||
IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle) const
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> guard(lock);
|
||||
for (size_t i = 0; i < fileSystems.size(); i++)
|
||||
@@ -368,6 +368,14 @@ PSPFileInfo MetaFileSystem::GetFileInfo(std::string filename)
|
||||
}
|
||||
}
|
||||
|
||||
PSPFileInfo MetaFileSystem::GetFileInfoByHandle(u32 handle) {
|
||||
std::lock_guard<std::recursive_mutex> guard(lock);
|
||||
IFileSystem *sys = GetHandleOwner(handle);
|
||||
if (sys)
|
||||
return sys->GetFileInfoByHandle(handle);
|
||||
return PSPFileInfo();
|
||||
}
|
||||
|
||||
std::vector<PSPFileInfo> MetaFileSystem::GetDirListing(const std::string &path, bool *exists) {
|
||||
std::lock_guard<std::recursive_mutex> guard(lock);
|
||||
std::string of;
|
||||
|
||||
Reference in New Issue
Block a user