rpcsx/rpcs3/Emu/FS/vfsDirBase.cpp
Peter Tissen 40add8f9a2 Seperate ConLog.h and ConLogFrame.h (for now only seperate headers)
make precompiled header slimmer under Linux to increase CI and dev-machine build-times

make sure unused modules don't compile
add unused modules to the VS project to easier keep track of them
2014-06-06 02:50:22 +02:00

61 lines
845 B
C++

#include "stdafx.h"
#include "vfsDevice.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();
if(!IsExists(path))
return false;
m_pos = 0;
m_cwd += '/' + path;
return true;
}
bool vfsDirBase::IsOpened() const
{
return !m_cwd.empty();
}
bool vfsDirBase::IsExists(const std::string& path) const
{
return wxDirExists(fmt::FromUTF8(path));
}
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++];
}