Simplify Filestream

This commit is contained in:
twinaphex 2017-12-15 21:43:29 +01:00
parent 42d9158102
commit 018e009006
6 changed files with 0 additions and 43 deletions

View File

@ -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)

View File

@ -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);

View File

@ -66,12 +66,6 @@ MemoryStream::~MemoryStream()
}
}
uint64 MemoryStream::attributes(void)
{
return (ATTRIBUTE_READABLE | ATTRIBUTE_WRITEABLE | ATTRIBUTE_SEEKABLE);
}
uint8 *MemoryStream::map(void)
{
return data_buffer;

View File

@ -37,8 +37,6 @@ class MemoryStream : public Stream
virtual ~MemoryStream();
virtual uint64 attributes(void);
virtual uint8 *map(void);
virtual void unmap(void);

View File

@ -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;

View File

@ -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;