Utility class that points to a specific position in a resource and offers an interface for sequential reading. More...
Public Member Functions | |
| Reader (const Resource &resource, std::size_t position) | |
| const Resource & | resource () const |
| std::size_t | position () const |
| void | setPosition (std::size_t value) |
| void | seek (std::ptrdiff_t offset) |
| void | read (void *destBuffer, std::size_t length) |
| template<typename T > | |
| void | readPod (T &t, ByteOrder bo=boDontCare) |
| Convenience function; equivalent to read(&t, sizeof t). | |
| template<typename T > | |
| T | getPod (ByteOrder bo=boDontCare) |
| Similar to readPod(T&), but returns the read value instead. | |
Utility class that points to a specific position in a resource and offers an interface for sequential reading.
| Gosu::Reader::Reader | ( | const Resource & | resource, |
| std::size_t | position | ||
| ) |
| T Gosu::Reader::getPod | ( | ByteOrder | bo = boDontCare | ) |
| void Gosu::Reader::read | ( | void * | destBuffer, |
| std::size_t | length | ||
| ) |
Referenced by readPod().
| void Gosu::Reader::readPod | ( | T & | t, |
| ByteOrder | bo = boDontCare |
||
| ) |
Convenience function; equivalent to read(&t, sizeof t).
Definition at line 63 of file IO.hpp.
References Gosu::otherByteOrder, and read().