The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fib::cReadBits Class Reference

#include <cReadBits.h>

Collaboration diagram for fib::cReadBits:

List of all members.

Public Member Functions

 cReadBits (istream &istreamIn, unsigned int uiBytsToBuffer=256)
 ~cReadBits ()
unsigned int readBits (char *pBuffer, unsigned int uiBitsToRead)
unsigned int readBits (int &iBuffer, unsigned int uiBitsToRead)
unsigned int readBits (long &lBuffer, unsigned int uiBitsToRead)
unsigned int readBits (long long &lBuffer, unsigned int uiBitsToRead)
unsigned int readBits (unsigned int &uiBuffer, unsigned int uiBitsToRead)
unsigned int readBits (unsigned long &ulBuffer, unsigned int uiBitsToRead)
unsigned int readBits (unsigned long long &ulBuffer, unsigned int uiBitsToRead)
unsigned int readTillNextFullByte ()
unsigned int rollbackBits (unsigned int uiBitsToRollback)
istream * getStream ()
unsigned long getBitReadedCount () const

Protected Attributes

char * szByteBuffer
unsigned int uiBitsToBuffer
unsigned int uiBitPositionBuffer
unsigned int uiBitReadedInBuffer
unsigned long ulBitReadedCount
istream * pIstream

Detailed Description

Definition at line 50 of file cReadBits.h.


Constructor & Destructor Documentation

fib::cReadBits::cReadBits ( istream &  istreamIn,
unsigned int  uiBytsToBuffer = 256 
)

Standardconstructor Beware: Don't use istreamIn elsewher, while using it with theas class. This class should only use istreamIn.

Parameters:
istreamInthe stream to read the bits from
uiBytsToBufferthe number of byts to buffer from the stream
fib::cReadBits::~cReadBits ( )

destructor


Member Function Documentation

unsigned long fib::cReadBits::getBitReadedCount ( ) const
Returns:
the number of bits readed from the stream or respectively the bitposition in the stream (rollbacks inclusive)
istream* fib::cReadBits::getStream ( )
Returns:
a pointer to the bufferd input stream Beware: The readposition will be after the byte of last readed bit, without the rollbacks.
unsigned int fib::cReadBits::readBits ( char *  pBuffer,
unsigned int  uiBitsToRead 
)

This method reads a number of bits from the stream.

Parameters:
pBufferthe character array wher to writes the readed bits to, the first bit will begin at the pointer pBuffer
uiBitsToReadthe number of bits to read
Returns:
the number of bits readed
unsigned int fib::cReadBits::readBits ( int &  iBuffer,
unsigned int  uiBitsToRead 
)

This method reads a number of bits from the stream into a integer variable.

Parameters:
iBuffera reference to the variable, wher to read the number to
uiBitsToReadthe number of bits to read
Returns:
the number of bits readed
unsigned int fib::cReadBits::readBits ( long &  lBuffer,
unsigned int  uiBitsToRead 
)

This method reads a number of bits from the stream into a integer variable.

Parameters:
lBuffera reference to the variable, wher to read the number to
uiBitsToReadthe number of bits to read
Returns:
the number of bits readed
unsigned int fib::cReadBits::readBits ( long long &  lBuffer,
unsigned int  uiBitsToRead 
)

This method reads a number of bits from the stream into a integer variable.

Parameters:
lBuffera reference to the variable, wher to read the number to
uiBitsToReadthe number of bits to read
Returns:
the number of bits readed
unsigned int fib::cReadBits::readBits ( unsigned int &  uiBuffer,
unsigned int  uiBitsToRead 
)

This method reads a number of bits from the stream into a integer variable.

Parameters:
uiBuffera reference to the variable, wher to read the number to
uiBitsToReadthe number of bits to read
Returns:
the number of bits readed
unsigned int fib::cReadBits::readBits ( unsigned long &  ulBuffer,
unsigned int  uiBitsToRead 
)

This method reads a number of bits from the stream into a integer variable.

Parameters:
uiBuffera reference to the variable, wher to read the number to
uiBitsToReadthe number of bits to read
Returns:
the number of bits readed
unsigned int fib::cReadBits::readBits ( unsigned long long &  ulBuffer,
unsigned int  uiBitsToRead 
)

This method reads a number of bits from the stream into a integer variable.

Parameters:
uiBuffera reference to the variable, wher to read the number to
uiBitsToReadthe number of bits to read
Returns:
the number of bits readed
unsigned int fib::cReadBits::readTillNextFullByte ( )

This method reads to the beginning of the next full byte, if it isn't allready readed to a full byte. After the method call the readpoint stands on the beginning of a byte, which is after or at the read position befor the call.

Returns:
the number of bits readed
unsigned int fib::cReadBits::rollbackBits ( unsigned int  uiBitsToRollback)

This function will rollbach uiBitsToRollback bits of the stream so they will be read again.

Parameters:
uiBitsToRollbackthe number of bits to rollback
Returns:
the number of bits rollbacked

Member Data Documentation

istream* fib::cReadBits::pIstream
protected

A pointer to the input stream to buffer.

Definition at line 83 of file cReadBits.h.

char* fib::cReadBits::szByteBuffer
protected

This is a pointer to the buffer wher the readed byts of the stream will be bufferd. The byts bufferd are readed round. If the end of the buffer is reached, the beginning is the next byte.

Definition at line 58 of file cReadBits.h.

unsigned int fib::cReadBits::uiBitPositionBuffer
protected

The bitposition in the buffer of the bit to read next from the buffer.

Definition at line 68 of file cReadBits.h.

unsigned int fib::cReadBits::uiBitReadedInBuffer
protected

The bitposition of the bit which will be stored next to the buffer.

Definition at line 73 of file cReadBits.h.

unsigned int fib::cReadBits::uiBitsToBuffer
protected

The number of byts to buffer.

Definition at line 63 of file cReadBits.h.

unsigned long fib::cReadBits::ulBitReadedCount
protected

The the number of bits readed from the stream.

Definition at line 78 of file cReadBits.h.


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