Base class for resources. More...
Public Member Functions | |
Resource () | |
virtual | ~Resource () |
Reader | frontReader () const |
Convenience: Creates a new Reader that reads from the start of the resource. More... | |
Writer | backWriter () |
Convenience: Creates a new Writer that appends data at the end of the resource. More... | |
virtual std::size_t | size () const =0 |
virtual void | resize (std::size_t newSize)=0 |
virtual void | read (std::size_t offset, std::size_t length, void *destBuffer) const =0 |
virtual void | write (std::size_t offset, std::size_t length, const void *sourceBuffer)=0 |
Base class for resources.
A resource in Gosu is nothing more but a piece of binary data that can be read or written, for example files or simply areas of allocated memory. A resource always knows its size and can resize itself, thereby either truncating its content or allocating room for more data.
Writer Gosu::Resource::backWriter | ( | ) |
Reader Gosu::Resource::frontReader | ( | ) | const |
|
pure virtual |
Implemented in Gosu::File, and Gosu::Buffer.
|
pure virtual |
Implemented in Gosu::File, and Gosu::Buffer.
|
pure virtual |
Implemented in Gosu::File, and Gosu::Buffer.
Referenced by backWriter().
|
pure virtual |
Implemented in Gosu::File, and Gosu::Buffer.