Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
Memory based input stream. More...
#include <gf/InputStreams.h>
Public Member Functions | |
MemoryInputStream (const void *data, std::size_t size) | |
Constructor. More... | |
virtual std::size_t | read (void *data, std::size_t size) override |
Read data from the stream. More... | |
virtual long | seek (long position) override |
Change the current reading position. More... | |
virtual long | tell () override |
Get the current reading position in the stream. More... | |
virtual std::size_t | getSize () override |
Return the size of the stream. More... | |
Public Member Functions inherited from gf::InputStream | |
InputStream ()=default | |
Default constructor. More... | |
InputStream (const InputStream &)=delete | |
Deleted copy constructor. More... | |
InputStream & | operator= (const InputStream &)=delete |
Deleted copy assignment. More... | |
virtual | ~InputStream () |
Destructor. More... | |
Memory based input stream.
gf::MemoryInputStream::MemoryInputStream | ( | const void * | data, |
std::size_t | size | ||
) |
Constructor.
This class does not own the memory. The user must keep the memory available when the stream is active.
data | Pointer to the data |
size | Size of the data |
|
overridevirtual |
Return the size of the stream.
Implements gf::InputStream.
|
overridevirtual |
Read data from the stream.
After reading, the stream's reading position must be advanced by the amount of bytes read.
data | Buffer where to copy the read data |
size | Desired number of bytes to read |
Implements gf::InputStream.
|
overridevirtual |
Change the current reading position.
position | The position to seek to, from the beginning |
Implements gf::InputStream.
|
overridevirtual |
Get the current reading position in the stream.
Implements gf::InputStream.