Gosu
Public Member Functions | List of all members
Gosu::Reader Class Reference

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 Resourceresource () const
 
std::size_t position () const
 
void set_position (std::size_t value)
 
void seek (std::ptrdiff_t offset)
 
void read (void *dest_buffer, std::size_t length)
 
template<typename T >
void read_pod (T &t, ByteOrder bo=BO_DONT_CARE)
 Convenience function; equivalent to read(&t, sizeof t). More...
 
template<typename T >
get_pod (ByteOrder bo=BO_DONT_CARE)
 Similar to read_pod(T&), but returns the read value instead. More...
 

Detailed Description

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

Definition at line 26 of file IO.hpp.

Constructor & Destructor Documentation

◆ Reader()

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

Definition at line 32 of file IO.hpp.

Referenced by Gosu::Resource::front_reader().

Member Function Documentation

◆ get_pod()

template<typename T >
T Gosu::Reader::get_pod ( ByteOrder  bo = BO_DONT_CARE)

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

Definition at line 74 of file IO.hpp.

◆ position()

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

Definition at line 42 of file IO.hpp.

◆ read()

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

◆ read_pod()

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

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

Definition at line 63 of file IO.hpp.

References read().

◆ resource()

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

Definition at line 37 of file IO.hpp.

◆ seek()

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

Definition at line 53 of file IO.hpp.

References read().

◆ set_position()

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

Definition at line 47 of file IO.hpp.


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