mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-25 16:24:53 +02:00
Add "GetFileInfoByHandle" function to (many) file systems
This commit is contained in:
@@ -638,6 +638,23 @@ PSPFileInfo ISOFileSystem::GetFileInfo(std::string filename) {
|
||||
return x;
|
||||
}
|
||||
|
||||
PSPFileInfo ISOFileSystem::GetFileInfoByHandle(u32 handle) {
|
||||
auto iter = entries.find(handle);
|
||||
PSPFileInfo x;
|
||||
if (iter != entries.end()) {
|
||||
const TreeEntry *entry = iter->second.file;
|
||||
x.name = entry->name;
|
||||
// Strangely, it seems to be executable even for files.
|
||||
x.access = 0555;
|
||||
x.size = entry->size;
|
||||
x.exists = true;
|
||||
x.type = entry->isDirectory ? FILETYPE_DIRECTORY : FILETYPE_NORMAL;
|
||||
x.isOnSectorSystem = true;
|
||||
x.startSector = entry->startingPosition / 2048;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
std::vector<PSPFileInfo> ISOFileSystem::GetDirListing(const std::string &path, bool *exists) {
|
||||
std::vector<PSPFileInfo> myVector;
|
||||
TreeEntry *entry = GetFromPath(path);
|
||||
|
||||
Reference in New Issue
Block a user