mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
VFS::DeleteAll, VFS::GetDirSize, VFS::Exists, VFS::Rename (VFS::RenameFile, VFS::RenameDir removed)
61 lines
788 B
C++
61 lines
788 B
C++
#include "stdafx.h"
|
|
#include "Utilities/File.h"
|
|
#include "vfsDirBase.h"
|
|
|
|
vfsDirBase::vfsDirBase(vfsDevice* device)
|
|
: m_pos(0)
|
|
, m_device(device)
|
|
{
|
|
}
|
|
|
|
vfsDirBase::~vfsDirBase()
|
|
{
|
|
}
|
|
|
|
bool vfsDirBase::Open(const std::string& path)
|
|
{
|
|
if (IsOpened())
|
|
{
|
|
Close();
|
|
}
|
|
|
|
m_pos = 0;
|
|
m_cwd += '/' + path;
|
|
return true;
|
|
}
|
|
|
|
bool vfsDirBase::IsOpened() const
|
|
{
|
|
return !m_cwd.empty();
|
|
}
|
|
|
|
const std::vector<DirEntryInfo>& vfsDirBase::GetEntries() const
|
|
{
|
|
return m_entries;
|
|
}
|
|
|
|
void vfsDirBase::Close()
|
|
{
|
|
m_cwd = "";
|
|
m_entries.clear();
|
|
}
|
|
|
|
std::string vfsDirBase::GetPath() const
|
|
{
|
|
return m_cwd;
|
|
}
|
|
|
|
const DirEntryInfo* vfsDirBase::Read()
|
|
{
|
|
if (m_pos >= m_entries.size())
|
|
return nullptr;
|
|
|
|
return &m_entries[m_pos++];
|
|
}
|
|
|
|
const DirEntryInfo* vfsDirBase::First()
|
|
{
|
|
m_pos = 0;
|
|
return Read();
|
|
}
|