Worldstone
|
An interface for a stream of data. More...
#include <Stream.h>
Public Types | |
enum | seekdir { beg, cur, end } |
Public Types inherited from WorldStone::IOBase | |
using | Path = std::string |
using | iostate = int |
Public Member Functions | |
bool | eof () const |
True if the end of the stream was reached during the last read operation. | |
virtual long | size ()=0 |
Compute the size of the file. More... | |
virtual size_t | read (void *buffer, size_t size)=0 |
Read data from the stream. More... | |
template<typename T > | |
bool | readRaw (T &out) |
virtual int | getc () |
Read one byte from the stream. More... | |
virtual long | tell ()=0 |
Return the current position of the stream pointer. More... | |
virtual bool | seek (long offset, seekdir origin)=0 |
Change the pointer of the stream to a given position. More... | |
Public Member Functions inherited from WorldStone::IOBase | |
operator bool () const | |
bool | operator! () const |
bool | good () const |
bool | eof () const |
bool | fail () const |
bool | bad () const |
Additional Inherited Members | |
Protected Member Functions inherited from WorldStone::IOBase | |
void | setstate (iostate state) |
Protected Attributes inherited from WorldStone::IOBase | |
iostate | _state = goodbit |
Static Protected Attributes inherited from WorldStone::IOBase | |
static constexpr iostate | goodbit = 0x0 |
static constexpr iostate | eofbit = 0x1 |
static constexpr iostate | failbit = 0x2 |
static constexpr iostate | badbit = 0x4 |
An interface for a stream of data.
While it can be used to abstract many types of streams, file streams are usually created through an
|
virtual |
Read one byte from the stream.
Reimplemented in WorldStone::FileStream.
Definition at line 17 of file _VTablesTU.cpp.
|
pure virtual |
Read data from the stream.
buffer | Pointer to a block of memory to fill. Must be at least 'size' bytes large. |
size | Number of bytes to copy |
Implemented in WorldStone::MpqFileStream, and WorldStone::FileStream.
|
pure virtual |
Change the pointer of the stream to a given position.
offset | The new position relative to the given reference position 'origin'. |
origin | Arbitrary reference to a position in the stream. |
Implemented in WorldStone::MpqFileStream, and WorldStone::FileStream.
|
pure virtual |
Compute the size of the file.
Implemented in WorldStone::MpqFileStream, and WorldStone::FileStream.
|
pure virtual |
Return the current position of the stream pointer.
Implemented in WorldStone::MpqFileStream, and WorldStone::FileStream.