rpcsx/rpcs3/Emu/FS/vfsLocalFile.cpp

65 lines
1.1 KiB
C++
Raw Normal View History

#include "stdafx.h"
#include "Utilities/Log.h"
#include "vfsLocalFile.h"
vfsLocalFile::vfsLocalFile(vfsDevice* device) : vfsFileBase(device)
{
}
2015-04-19 15:19:24 +02:00
bool vfsLocalFile::Open(const std::string& path, u32 mode)
{
Close();
2015-04-19 15:19:24 +02:00
return m_file.open(path, mode) && vfsFileBase::Open(path, mode);
}
bool vfsLocalFile::Close()
{
2015-04-19 15:19:24 +02:00
return m_file.close() && vfsFileBase::Close();
}
2015-04-19 15:19:24 +02:00
u64 vfsLocalFile::GetSize() const
{
2015-04-19 15:19:24 +02:00
return m_file.size();
}
u64 vfsLocalFile::Write(const void* src, u64 size)
{
2015-04-19 15:19:24 +02:00
return m_file.write(src, size);
}
u64 vfsLocalFile::Read(void* dst, u64 size)
{
2015-04-19 15:19:24 +02:00
return m_file.read(dst, size);
}
2015-04-19 15:19:24 +02:00
u64 vfsLocalFile::Seek(s64 offset, u32 mode)
{
2015-04-19 15:19:24 +02:00
return m_file.seek(offset, mode);
}
u64 vfsLocalFile::Tell() const
{
2015-04-19 15:19:24 +02:00
return m_file.seek(0, from_cur);
}
bool vfsLocalFile::IsOpened() const
{
2015-04-19 15:19:24 +02:00
return m_file /*&& vfsFileBase::IsOpened()*/;
}
2014-07-01 14:21:55 +02:00
bool vfsLocalFile::Exists(const std::string& path)
{
return rExists(path);
2015-03-16 17:20:02 +01:00
}
bool vfsLocalFile::Rename(const std::string& from, const std::string& to)
{
return rRename(from, to);
}
bool vfsLocalFile::Remove(const std::string& path)
{
return rRemoveFile(path);
}