Directory-related functions implemented

* cellFsOpendir, cellFsReaddir, cellFsClosedir functions implemented.
* vfsDirBase: m_entryes, GetEntryes renamed to m_entries, GetEntries
respectively.
* vfsLocalDir: Read() function added to get the entries one by one.
* Moved IsExists() from vfsLocalDir to vfsDirBase to avoid "R6025 pure
virtual function call" error.
* Other minor changes in some functions of sys_fs
This commit is contained in:
Alexandro Sánchez Bach 2014-02-09 22:53:48 +01:00
parent 27a4e6a2b6
commit 4d98826259
8 changed files with 88 additions and 36 deletions

View file

@ -2,7 +2,9 @@
#include "vfsLocalDir.h"
#include <direct.h>
vfsLocalDir::vfsLocalDir(const wxString& path) : vfsDirBase(path)
vfsLocalDir::vfsLocalDir(const wxString& path)
: vfsDirBase(path)
, m_pos(0)
{
}
@ -25,7 +27,7 @@ bool vfsLocalDir::Open(const wxString& path)
{
wxString dir_path = path + wxFILE_SEP_PATH + name;
DirEntryInfo& info = m_entryes[m_entryes.Move(new DirEntryInfo())];
DirEntryInfo& info = m_entries[m_entries.Move(new DirEntryInfo())];
info.name = name;
info.flags |= wxDirExists(dir_path) ? DirEntry_TypeDir : DirEntry_TypeFile;
@ -37,16 +39,19 @@ bool vfsLocalDir::Open(const wxString& path)
return true;
}
const DirEntryInfo* vfsLocalDir::Read()
{
if (m_pos >= m_entries.GetCount())
return 0;
return &m_entries[m_pos++];
}
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;