libSDL2pp
C++ bindings/wrapper for SDL2
|
Base class for custom RWops. More...
#include <SDL2pp/RWops.hh>
Public Member Functions | |
virtual | ~CustomRWops () |
Destructor. | |
virtual Sint64 | Size ()=0 |
Get the size of the data stream. | |
virtual Sint64 | Seek (Sint64 offset, int whence)=0 |
Seek within the data stream. | |
virtual size_t | Read (void *ptr, size_t size, size_t maxnum)=0 |
Read from a data stream. | |
virtual size_t | Write (const void *ptr, size_t size, size_t num)=0 |
Write to a data stream. | |
virtual int | Close ()=0 |
Close data source. | |
Base class for custom RWops.
Derive from this class and override 4 virtual methods used to Seek, Read, Write and Close the data stream. The derived class is expected to be moved-into RWops via RWops(C&& custom_rwops).
|
inlinevirtual |
Destructor.
|
pure virtual |
Close data source.
Implemented in SDL2pp::ContainerRWops< C >, and SDL2pp::StreamRWops< S >.
|
pure virtual |
Read from a data 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 |
Implemented in SDL2pp::ContainerRWops< C >, and SDL2pp::StreamRWops< S >.
|
pure virtual |
Seek within the data 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 |
Implemented in SDL2pp::ContainerRWops< C >, and SDL2pp::StreamRWops< S >.
|
pure virtual |
Get the size of the data stream.
Implemented in SDL2pp::ContainerRWops< C >, and SDL2pp::StreamRWops< S >.
|
pure virtual |
Write to a data stream.
[in] | ptr | Pointer to a buffer containing data to write |
[in] | size | Size of each object to write, in bytes |
[in] | num | Maximum number of objects to be write |
Implemented in SDL2pp::ContainerRWops< C >, and SDL2pp::StreamRWops< S >.