mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 02:38:37 +12:00
Implemented vfsLocalDir & vfsDirBase.
Improved ThreadBase. Minor fixes.
This commit is contained in:
parent
16c284214f
commit
beb19633e9
16 changed files with 187 additions and 53 deletions
58
rpcs3/Emu/FS/vfsLocalDir.cpp
Normal file
58
rpcs3/Emu/FS/vfsLocalDir.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
#include "stdafx.h"
|
||||
#include "vfsLocalDir.h"
|
||||
#include <direct.h>
|
||||
|
||||
vfsLocalDir::vfsLocalDir(const wxString& path) : vfsDirBase(path)
|
||||
{
|
||||
}
|
||||
|
||||
vfsLocalDir::~vfsLocalDir()
|
||||
{
|
||||
}
|
||||
|
||||
bool vfsLocalDir::Open(const wxString& path)
|
||||
{
|
||||
if(!vfsDirBase::Open(path))
|
||||
return false;
|
||||
|
||||
wxDir dir;
|
||||
|
||||
if(!dir.Open(path))
|
||||
return false;
|
||||
|
||||
wxString name;
|
||||
for(bool is_ok = dir.GetFirst(&name); is_ok; is_ok = dir.GetNext(&name))
|
||||
{
|
||||
wxString dir_path = path + wxFILE_SEP_PATH + name;
|
||||
|
||||
DirEntryInfo& info = m_entryes[m_entryes.Add(new DirEntryInfo())];
|
||||
info.name = name;
|
||||
|
||||
info.flags |= wxDirExists(dir_path) ? DirEntry_TypeDir : DirEntry_TypeFile;
|
||||
if(wxIsWritable(dir_path)) info.flags |= DirEntry_PermWritable;
|
||||
if(wxIsReadable(dir_path)) info.flags |= DirEntry_PermReadable;
|
||||
if(wxIsExecutable(dir_path)) info.flags |= DirEntry_PermExecutable;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool vfsLocalDir::Create(const wxString& path)
|
||||
{
|
||||
return wxFileName::Mkdir(path, 0777, wxPATH_MKDIR_FULL);
|
||||
}
|
||||
|
||||
bool vfsLocalDir::IsExists(const wxString& path) const
|
||||
{
|
||||
return wxDirExists(path);
|
||||
}
|
||||
|
||||
bool vfsLocalDir::Rename(const wxString& from, const wxString& to)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool vfsLocalDir::Remove(const wxString& path)
|
||||
{
|
||||
return wxRmdir(path);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue