2018-08-26 20:22:38 -04:00
|
|
|
#pragma once
|
2008-01-15 20:27:44 +00:00
|
|
|
|
|
|
|
#include "Stream.h"
|
2023-01-05 20:07:15 -05:00
|
|
|
#include "Ioman_Defs.h"
|
2022-02-25 17:32:56 -05:00
|
|
|
#include "Ioman_DirectoryIterator.h"
|
2022-02-25 17:43:25 -05:00
|
|
|
#include "filesystem_def.h"
|
2008-01-15 20:27:44 +00:00
|
|
|
|
|
|
|
namespace Iop
|
|
|
|
{
|
2012-09-05 20:40:23 +00:00
|
|
|
namespace Ioman
|
|
|
|
{
|
|
|
|
class CDevice
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum OPEN_FLAGS
|
|
|
|
{
|
2018-04-30 21:01:23 +01:00
|
|
|
OPEN_FLAG_RDONLY = 0x00000001,
|
|
|
|
OPEN_FLAG_WRONLY = 0x00000002,
|
|
|
|
OPEN_FLAG_RDWR = 0x00000003,
|
|
|
|
OPEN_FLAG_ACCMODE = 0x00000003,
|
|
|
|
OPEN_FLAG_CREAT = 0x00000200,
|
2018-05-10 19:19:01 -04:00
|
|
|
OPEN_FLAG_TRUNC = 0x00000400,
|
2019-08-01 18:09:58 -04:00
|
|
|
OPEN_FLAG_NOWAIT = 0x00008000, //This is probably only used by EE's FIO library
|
2012-09-05 20:40:23 +00:00
|
|
|
};
|
2008-01-15 20:27:44 +00:00
|
|
|
|
2018-08-26 20:22:38 -04:00
|
|
|
virtual ~CDevice() = default;
|
2018-04-30 21:01:23 +01:00
|
|
|
virtual Framework::CStream* GetFile(uint32, const char*) = 0;
|
2022-02-25 17:32:56 -05:00
|
|
|
virtual DirectoryIteratorPtr GetDirectory(const char*) = 0;
|
2021-01-06 11:06:44 -05:00
|
|
|
virtual void MakeDirectory(const char*)
|
2020-04-23 17:00:09 +02:00
|
|
|
{
|
2021-01-05 17:12:08 -05:00
|
|
|
throw std::runtime_error("Directory creation not supported.");
|
2020-04-23 17:00:09 +02:00
|
|
|
}
|
2023-01-03 21:18:18 -05:00
|
|
|
virtual std::shared_ptr<CDevice> Mount(const char*)
|
2021-01-05 17:19:49 -05:00
|
|
|
{
|
|
|
|
throw std::runtime_error("Mounting not supported.");
|
|
|
|
}
|
2023-01-05 20:07:15 -05:00
|
|
|
virtual bool TryGetStat(const char*, bool&, STAT&)
|
|
|
|
{
|
|
|
|
//Return false to indicate that device doesn't support GetStat.
|
|
|
|
return false;
|
|
|
|
}
|
2024-08-12 18:10:33 -04:00
|
|
|
virtual void Rename(const char*, const char*)
|
|
|
|
{
|
|
|
|
throw std::runtime_error("Renaming not supported.");
|
|
|
|
}
|
2012-09-05 20:40:23 +00:00
|
|
|
};
|
2023-01-06 12:26:39 -05:00
|
|
|
|
2023-01-03 21:18:18 -05:00
|
|
|
typedef std::shared_ptr<CDevice> DevicePtr;
|
2012-09-05 20:40:23 +00:00
|
|
|
}
|
2008-01-15 20:27:44 +00:00
|
|
|
}
|