libSDL2pp
C++ bindings/wrapper for SDL2
|
RWops adaptor for STL streams. More...
#include <SDL2pp/StreamRWops.hh>
Public Member Functions | |
StreamRWops (S &stream) | |
Construct StreamRWops for specified stream. | |
virtual Sint64 | Size () override |
Get the size of the data stream. | |
virtual Sint64 | Seek (Sint64 offset, int whence) override |
Seek within the stream. | |
virtual size_t | Read (void *ptr, size_t size, size_t maxnum) override |
Read from a stream. | |
virtual size_t | Write (const void *ptr, size_t size, size_t num) override |
Write to a stream. | |
virtual int | Close () override |
Close stream. | |
![]() | |
virtual | ~CustomRWops () |
Destructor. | |
Protected Attributes | |
S & | stream_ |
Reference to stream. | |
RWops adaptor for STL streams.
This class extends functionality of RWops concept onto STL streams. With ContainerRWops, you may read from / write to STL streams with SDL functions.
This template supports both input and output streams, but not at the same time, as separate input and output pointers of streams are not compatible with RWops.
|
inline |
Construct StreamRWops for specified stream.
[in] | stream | Stream to use |
|
inlineoverridevirtual |
Close stream.
Implements SDL2pp::CustomRWops.
|
inlineoverridevirtual |
Read from a stream.
[in] | ptr | Pointer to a buffer to read data into |
[in] | size | Size of each object to read, in bytes |
[in] | maxnum | Maximum number of objects to be read |
Implements SDL2pp::CustomRWops.
|
inlineoverridevirtual |
Seek within the stream.
[in] | offset | Offset in bytes, relative to whence location; can be negative |
[in] | whence | Any of RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END |
Implements SDL2pp::CustomRWops.
|
inlineoverridevirtual |
Get the size of the data stream.
Implements SDL2pp::CustomRWops.
|
inlineoverridevirtual |
Write to a stream.
[in] | ptr | Pointer to a buffer containing data to write |
[in] | size | Size of each object to write, in bytes |
[in] | num | Number of objects to be write |
Implements SDL2pp::CustomRWops.