mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
55 lines
1.1 KiB
C++
55 lines
1.1 KiB
C++
#include "stdafx.h"
|
|
#include "vfsDevice.h"
|
|
#include "vfsLocalDir.h"
|
|
|
|
vfsLocalDir::vfsLocalDir(vfsDevice* device) : vfsDirBase(device)
|
|
{
|
|
}
|
|
|
|
vfsLocalDir::~vfsLocalDir()
|
|
{
|
|
}
|
|
|
|
bool vfsLocalDir::Open(const std::string& path)
|
|
{
|
|
if(!vfsDirBase::Open(path))
|
|
return false;
|
|
|
|
rDir dir;
|
|
|
|
if(!dir.Open(path))
|
|
return false;
|
|
|
|
std::string name;
|
|
for(bool is_ok = dir.GetFirst(&name); is_ok; is_ok = dir.GetNext(&name))
|
|
{
|
|
std::string dir_path = path + name;
|
|
|
|
m_entries.emplace_back();
|
|
DirEntryInfo& info = m_entries.back();
|
|
info.name = name;
|
|
|
|
info.flags |= dir.Exists(dir_path) ? DirEntry_TypeDir : DirEntry_TypeFile;
|
|
if(rIsWritable(dir_path)) info.flags |= DirEntry_PermWritable;
|
|
if(rIsReadable(dir_path)) info.flags |= DirEntry_PermReadable;
|
|
if(rIsExecutable(dir_path)) info.flags |= DirEntry_PermExecutable;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
bool vfsLocalDir::Create(const std::string& path)
|
|
{
|
|
return rMkpath(path);
|
|
}
|
|
|
|
bool vfsLocalDir::Rename(const std::string& from, const std::string& to)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool vfsLocalDir::Remove(const std::string& path)
|
|
{
|
|
return rRmdir(path);
|
|
}
|