foobar2000 SDK  2015-08-03
Public Member Functions | Data Fields
stream_reader_formatter< isBigEndian >

#include <filesystem_helper.h>

Public Member Functions

 stream_reader_formatter (stream_reader &p_stream, abort_callback &p_abort)
 
template<typename TArray >
void read_array (TArray &data)
 
template<typename TArray >
void read_byte_block (TArray &data)
 
template<typename t_int >
void read_int (t_int &p_out)
 
void read_raw (void *p_buffer, t_size p_bytes)
 
template<typename TArray >
void read_raw (TArray &data)
 
void read_string_nullterm (pfc::string_base &out)
 
void skip (t_size p_bytes)
 

Data Fields

abort_callbackm_abort
 
stream_readerm_stream
 

Detailed Description

template<bool isBigEndian = false>
class stream_reader_formatter< isBigEndian >

Definition at line 396 of file filesystem_helper.h.

Constructor & Destructor Documentation

template<bool isBigEndian = false>
stream_reader_formatter< isBigEndian >::stream_reader_formatter ( stream_reader p_stream,
abort_callback p_abort 
)
inline

Definition at line 398 of file filesystem_helper.h.

398 : m_stream(p_stream), m_abort(p_abort) {}

Member Function Documentation

template<bool isBigEndian = false>
template<typename TArray >
void stream_reader_formatter< isBigEndian >::read_array ( TArray &  data)
inline

Definition at line 420 of file filesystem_helper.h.

420  {
421  t_uint32 size; *this >> size; data.set_size(size);
422  for(t_uint32 walk = 0; walk < size; ++walk) *this >> data[walk];
423  }
uint32_t t_uint32
Definition: int_types.h:5
template<bool isBigEndian = false>
template<typename TArray >
void stream_reader_formatter< isBigEndian >::read_byte_block ( TArray &  data)
inline

Definition at line 415 of file filesystem_helper.h.

415  {
417  t_uint32 size; read_int(size); data.set_size(size);
418  read_raw(data);
419  }
void read_int(t_int &p_out)
void read_raw(void *p_buffer, t_size p_bytes)
uint32_t t_uint32
Definition: int_types.h:5
template<bool isBigEndian = false>
template<typename t_int >
void stream_reader_formatter< isBigEndian >::read_int ( t_int p_out)
inline

Definition at line 400 of file filesystem_helper.h.

400  {
401  if (isBigEndian) m_stream.read_bendian_t(p_out,m_abort);
402  else m_stream.read_lendian_t(p_out,m_abort);
403  }
template<bool isBigEndian = false>
void stream_reader_formatter< isBigEndian >::read_raw ( void *  p_buffer,
t_size  p_bytes 
)
inline

Definition at line 405 of file filesystem_helper.h.

405  {
406  m_stream.read_object(p_buffer,p_bytes,m_abort);
407  }
template<bool isBigEndian = false>
template<typename TArray >
void stream_reader_formatter< isBigEndian >::read_raw ( TArray &  data)
inline

Definition at line 411 of file filesystem_helper.h.

411  {
413  read_raw(data.get_ptr(),data.get_size());
414  }
void read_raw(void *p_buffer, t_size p_bytes)
template<bool isBigEndian = false>
void stream_reader_formatter< isBigEndian >::read_string_nullterm ( pfc::string_base out)
inline

Definition at line 424 of file filesystem_helper.h.

424  {
425  m_stream.read_string_nullterm( out, m_abort );
426  }
template<bool isBigEndian = false>
void stream_reader_formatter< isBigEndian >::skip ( t_size  p_bytes)
inline

Definition at line 409 of file filesystem_helper.h.

409 {m_stream.skip_object(p_bytes,m_abort);}

Field Documentation

template<bool isBigEndian = false>
abort_callback& stream_reader_formatter< isBigEndian >::m_abort

Definition at line 428 of file filesystem_helper.h.

template<bool isBigEndian = false>
stream_reader& stream_reader_formatter< isBigEndian >::m_stream

Definition at line 427 of file filesystem_helper.h.


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