foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
bitreader_helper::bitreader_fromfile

#include <bitreader_helper.h>

Public Member Functions

 bitreader_fromfile (service_ptr_t< file > const &p_file)
 
void byte_align ()
 
t_size read (t_size p_bits, abort_callback &p_abort)
 
void skip (t_size p_bits, abort_callback &p_abort)
 

Private Attributes

t_uint8 m_buffer
 
t_size m_buffer_ptr
 
service_ptr_t< filem_file
 

Detailed Description

Definition at line 58 of file bitreader_helper.h.

Constructor & Destructor Documentation

bitreader_helper::bitreader_fromfile::bitreader_fromfile ( service_ptr_t< file > const &  p_file)
inline

Definition at line 61 of file bitreader_helper.h.

Member Function Documentation

void bitreader_helper::bitreader_fromfile::byte_align ( )
inline

Definition at line 83 of file bitreader_helper.h.

t_size bitreader_helper::bitreader_fromfile::read ( t_size  p_bits,
abort_callback p_abort 
)
inline

Definition at line 63 of file bitreader_helper.h.

63  {
64  t_size ret = 0;
65  for(t_size bit=0;bit<p_bits;bit++) {
66  if (m_buffer_ptr == 0)
67  m_file->read_object(&m_buffer,1,p_abort);
68 
69  ret <<= 1;
70  ret |= (m_buffer >> (7-m_buffer_ptr))&1;
71  m_buffer_ptr = (m_buffer_ptr+1) & 7;
72  }
73  return ret;
74  }
size_t t_size
Definition: int_types.h:48
void bitreader_helper::bitreader_fromfile::skip ( t_size  p_bits,
abort_callback p_abort 
)
inline

Definition at line 76 of file bitreader_helper.h.

76  {
77  for(t_size bit=0;bit<p_bits;bit++) {
78  if (m_buffer_ptr == 0) m_file->read_object(&m_buffer,1,p_abort);
79  m_buffer_ptr = (m_buffer_ptr+1) & 7;
80  }
81  }
size_t t_size
Definition: int_types.h:48

Field Documentation

t_uint8 bitreader_helper::bitreader_fromfile::m_buffer
private

Definition at line 88 of file bitreader_helper.h.

t_size bitreader_helper::bitreader_fromfile::m_buffer_ptr
private

Definition at line 87 of file bitreader_helper.h.

service_ptr_t<file> bitreader_helper::bitreader_fromfile::m_file
private

Definition at line 86 of file bitreader_helper.h.


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