Improved VFS

- Implemended vfsDir.
- Improved vfsDevice.
- Improved vfsFile.
This commit is contained in:
DH 2014-02-16 17:19:06 +02:00
parent 5d59dae730
commit 321d323beb
36 changed files with 479 additions and 390 deletions

70
rpcs3/Emu/FS/vfsDir.cpp Normal file
View file

@ -0,0 +1,70 @@
#include "stdafx.h"
#include "vfsDir.h"
vfsDir::vfsDir()
: vfsDirBase(nullptr)
, m_stream(nullptr)
{
}
vfsDir::vfsDir(const wxString path)
: vfsDirBase(nullptr)
, m_stream(nullptr)
{
Open(path);
}
bool vfsDir::Open(const wxString& path)
{
Close();
m_stream = Emu.GetVFS().OpenDir(path);
return m_stream && m_stream->IsOpened();
}
bool vfsDir::Create(const wxString& path)
{
return m_stream->Create(path);
}
bool vfsDir::IsExists(const wxString& path) const
{
return m_stream->IsExists(path);
}
const Array<DirEntryInfo>& vfsDir::GetEntries() const
{
return m_stream->GetEntries();
}
bool vfsDir::Rename(const wxString& from, const wxString& to)
{
return m_stream->Rename(from, to);
}
bool vfsDir::Remove(const wxString& path)
{
return m_stream->Remove(path);
}
const DirEntryInfo* vfsDir::Read()
{
return m_stream->Read();
}
void vfsDir::Close()
{
m_stream.reset();
return vfsDirBase::Close();
}
wxString vfsDir::GetPath() const
{
return m_stream->GetPath();
}
bool vfsDir::IsOpened() const
{
return m_stream && m_stream->IsOpened() && vfsDirBase::IsOpened();
}