mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2024-11-23 08:49:47 +00:00
Simplify Filestream
This commit is contained in:
parent
42d9158102
commit
018e009006
@ -45,25 +45,6 @@ FileStream::~FileStream()
|
||||
original_path = NULL;
|
||||
}
|
||||
|
||||
uint64_t FileStream::attributes(void)
|
||||
{
|
||||
uint64_t ret = ATTRIBUTE_SEEKABLE;
|
||||
|
||||
switch(OpenedMode)
|
||||
{
|
||||
case MODE_READ:
|
||||
ret |= ATTRIBUTE_READABLE;
|
||||
break;
|
||||
case MODE_WRITE_INPLACE:
|
||||
case MODE_WRITE_SAFE:
|
||||
case MODE_WRITE:
|
||||
ret |= ATTRIBUTE_WRITEABLE;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint64_t FileStream::read(void *data, uint64_t count, bool error_on_eos)
|
||||
{
|
||||
if (!fp)
|
||||
|
@ -31,8 +31,6 @@ class FileStream : public Stream
|
||||
FileStream(const char *path, const int mode);
|
||||
virtual ~FileStream();
|
||||
|
||||
virtual uint64_t attributes(void);
|
||||
|
||||
virtual uint64_t read(void *data, uint64_t count, bool error_on_eos = true);
|
||||
virtual void write(const void *data, uint64_t count);
|
||||
virtual void seek(int64_t offset, int whence);
|
||||
|
@ -66,12 +66,6 @@ MemoryStream::~MemoryStream()
|
||||
}
|
||||
}
|
||||
|
||||
uint64 MemoryStream::attributes(void)
|
||||
{
|
||||
return (ATTRIBUTE_READABLE | ATTRIBUTE_WRITEABLE | ATTRIBUTE_SEEKABLE);
|
||||
}
|
||||
|
||||
|
||||
uint8 *MemoryStream::map(void)
|
||||
{
|
||||
return data_buffer;
|
||||
|
@ -37,8 +37,6 @@ class MemoryStream : public Stream
|
||||
|
||||
virtual ~MemoryStream();
|
||||
|
||||
virtual uint64 attributes(void);
|
||||
|
||||
virtual uint8 *map(void);
|
||||
virtual void unmap(void);
|
||||
|
||||
|
@ -22,14 +22,6 @@ class Stream
|
||||
Stream();
|
||||
virtual ~Stream();
|
||||
|
||||
enum
|
||||
{
|
||||
ATTRIBUTE_READABLE = 0,
|
||||
ATTRIBUTE_WRITEABLE,
|
||||
ATTRIBUTE_SEEKABLE
|
||||
};
|
||||
virtual uint64_t attributes(void) = 0;
|
||||
|
||||
virtual uint64_t read(void *data, uint64_t count, bool error_on_eos = true) = 0;
|
||||
virtual void write(const void *data, uint64_t count) = 0;
|
||||
|
||||
|
@ -685,7 +685,6 @@ class CDIF_Stream_Thing : public Stream
|
||||
CDIF_Stream_Thing(CDIF *cdintf_arg, uint32 lba_arg, uint32 sector_count_arg);
|
||||
~CDIF_Stream_Thing();
|
||||
|
||||
virtual uint64 attributes(void);
|
||||
virtual uint8 *map(void);
|
||||
virtual void unmap(void);
|
||||
|
||||
@ -716,11 +715,6 @@ CDIF_Stream_Thing::~CDIF_Stream_Thing()
|
||||
|
||||
}
|
||||
|
||||
uint64 CDIF_Stream_Thing::attributes(void)
|
||||
{
|
||||
return(ATTRIBUTE_READABLE | ATTRIBUTE_SEEKABLE);
|
||||
}
|
||||
|
||||
uint8 *CDIF_Stream_Thing::map(void)
|
||||
{
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user