Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
File based input stream. More...
#include <gf/InputStreams.h>
Public Member Functions | |
FileInputStream (const Path &path) | |
Constructor. More... | |
~FileInputStream () | |
Destructor. 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... | |
File based input stream.
|
explicit |
Constructor.
The constructor opens the file. If the file is not opened, the operations will return default values.
path | The path to the file |
gf::FileInputStream::~FileInputStream | ( | ) |
Destructor.
The destructor closes the file.
|
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.