rpcsx/rpcs3/Emu/FS/vfsDir.cpp
DH 321d323beb Improved VFS
- Implemended vfsDir.
- Improved vfsDevice.
- Improved vfsFile.
2014-02-16 17:19:06 +02:00

71 lines
1.1 KiB
C++

#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();
}