Gosu::Reader Class Reference

Utility class that points to a specific position in a resource and offers an interface for sequential reading. More...

List of all members.

Public Member Functions

 Reader (const Resource &resource, std::size_t position)
const Resourceresource () 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 >
getPod (ByteOrder bo=boDontCare)
 Similar to readPod(T&), but returns the read value instead.


Detailed Description

Utility class that points to a specific position in a resource and offers an interface for sequential reading.

Definition at line 27 of file IO.hpp.


Constructor & Destructor Documentation

Gosu::Reader::Reader ( const Resource resource,
std::size_t  position 
)

Definition at line 33 of file IO.hpp.


Member Function Documentation

template<typename T >
T Gosu::Reader::getPod ( ByteOrder  bo = boDontCare  ) 

Similar to readPod(T&), but returns the read value instead.

Definition at line 76 of file IO.hpp.

std::size_t Gosu::Reader::position (  )  const

Definition at line 43 of file IO.hpp.

void Gosu::Reader::read ( void *  destBuffer,
std::size_t  length 
)

Referenced by readPod().

template<typename T >
void Gosu::Reader::readPod ( T &  t,
ByteOrder  bo = boDontCare 
)

Convenience function; equivalent to read(&t, sizeof t).

Definition at line 64 of file IO.hpp.

References Gosu::otherByteOrder, and read().

const Resource& Gosu::Reader::resource (  )  const

Definition at line 38 of file IO.hpp.

void Gosu::Reader::seek ( std::ptrdiff_t  offset  ) 

Definition at line 54 of file IO.hpp.

void Gosu::Reader::setPosition ( std::size_t  value  ) 

Definition at line 48 of file IO.hpp.


The documentation for this class was generated from the following file: