CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
Loading...
Searching...
No Matches
Public Member Functions | List of all members
memory_buffer Class Reference

Public Member Functions

 memory_buffer ()
 
 memory_buffer (const uint8_t *pData, size_t iLength)
 
 ~memory_buffer ()
 
uint8_t * take_data (size_t *pLength)
 
size_t tell () const
 
bool seek (size_t position)
 
bool skip (std::ptrdiff_t distance)
 
bool scan_to (const void *pData, size_t iLength)
 
const charget_pointer () const
 
template<class T >
bool read (T &value)
 
template<class T >
bool read (T *values, size_t count)
 
uint32_t read_big_endian_uint24 ()
 
uint32_t read_variable_length_uint ()
 
template<class T >
bool write (const T &value)
 
template<class T >
bool write (const T *values, size_t count)
 
bool write_big_endian_uint16 (uint16_t iValue)
 
bool write_big_endian_uint32 (uint32_t iValue)
 
bool write_variable_length_uint (unsigned int iValue)
 
bool is_end_of_buffer () const
 

Detailed Description

Utility class for reading or writing to memory as if it were a file.

Constructor & Destructor Documentation

◆ memory_buffer() [1/2]

memory_buffer::memory_buffer ( )
inline

◆ memory_buffer() [2/2]

memory_buffer::memory_buffer ( const uint8_t *  pData,
size_t  iLength 
)
inline

◆ ~memory_buffer()

memory_buffer::~memory_buffer ( )
inline

Member Function Documentation

◆ get_pointer()

const char * memory_buffer::get_pointer ( ) const
inline

◆ is_end_of_buffer()

bool memory_buffer::is_end_of_buffer ( ) const
inline

◆ read() [1/2]

template<class T >
bool memory_buffer::read ( T &  value)
inline

◆ read() [2/2]

template<class T >
bool memory_buffer::read ( T *  values,
size_t  count 
)
inline

◆ read_big_endian_uint24()

uint32_t memory_buffer::read_big_endian_uint24 ( )
inline

◆ read_variable_length_uint()

uint32_t memory_buffer::read_variable_length_uint ( )
inline

◆ scan_to()

bool memory_buffer::scan_to ( const void pData,
size_t  iLength 
)
inline

◆ seek()

bool memory_buffer::seek ( size_t  position)
inline

◆ skip()

bool memory_buffer::skip ( std::ptrdiff_t  distance)
inline

◆ take_data()

uint8_t * memory_buffer::take_data ( size_t *  pLength)
inline

◆ tell()

size_t memory_buffer::tell ( ) const
inline

◆ write() [1/2]

template<class T >
bool memory_buffer::write ( const T &  value)
inline

◆ write() [2/2]

template<class T >
bool memory_buffer::write ( const T *  values,
size_t  count 
)
inline

◆ write_big_endian_uint16()

bool memory_buffer::write_big_endian_uint16 ( uint16_t  iValue)
inline

◆ write_big_endian_uint32()

bool memory_buffer::write_big_endian_uint32 ( uint32_t  iValue)
inline

◆ write_variable_length_uint()

bool memory_buffer::write_variable_length_uint ( unsigned int  iValue)
inline

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