rpcs3/rpcs3/Emu/FS/vfsFileBase.h
Nekotekina 3b26031692 Bugfix
2015-04-20 01:26:28 +03:00

34 lines
841 B
C++

#pragma once
#include "vfsStream.h"
enum vfsOpenMode : u32
{
vfsRead = o_read,
vfsReadWrite = o_read | o_write,
vfsWriteNew = o_write | o_create | o_trunc,
vfsWriteExcl = o_write | o_create | o_excl,
};
class vfsDevice;
struct vfsFileBase : public vfsStream
{
protected:
std::string m_path;
u32 m_mode;
vfsDevice* m_device;
public:
vfsFileBase(vfsDevice* device);
virtual ~vfsFileBase() override;
virtual bool Open(const std::string& path, u32 mode);
virtual bool Close() override;
virtual bool Exists(const std::string& path) { return false; }
virtual bool Rename(const std::string& from, const std::string& to) { return false; }
virtual bool Remove(const std::string& path) { return false; }
virtual bool IsOpened() const override { return !m_path.empty(); }
std::string GetPath() const;
u32 GetOpenMode() const;
};