Octane v1.01.20 - The Open Compression Toolkit for C++ http://octane.sourceforge.net/
Homepage | Main | Modules | Class Hierarchy | Compound List | File List | Compound Members | Related Pages

string_bitreader Class Reference
[bitio]

#include <bitreaders.hpp>

Inheritance diagram for string_bitreader:

bitreader List of all members.

Detailed Description

Specialization for string.

Definition at line 93 of file bitreaders.hpp.

Public Member Functions

 string_bitreader (const std::string &_s)
 Constructor.

 string_bitreader (const std::string &_s, size_t size_in_bits)
 Constructor with size specification.

bool supports_seek () const
 Check if seek functions are supported.


Protected Member Functions

char read_next_byte ()
 Defines the method of reading a single byte of input.

void set_position (size_t pos)
 Defines the method of setting the position for the next read.


Protected Attributes

const std::string & s
size_t index


Constructor & Destructor Documentation

string_bitreader::string_bitreader const std::string &  _s  )  [inline]
 

Constructor.

Sets the number of bits available to the size of the string.

Parameters:
_s - the string to use.

Definition at line 99 of file bitreaders.hpp.

00100         : bitreader(8 * _s.size()), s(_s), index(0)
00101     { ; }

string_bitreader::string_bitreader const std::string &  _s,
size_t  size_in_bits
[inline]
 

Constructor with size specification.

Parameters:
_s - the string to use.
size_in_bits - the number of bits available.

Definition at line 105 of file bitreaders.hpp.

00106         : bitreader(size_in_bits), s(_s), index(0) { ; }


Member Function Documentation

bool string_bitreader::supports_seek  )  const [inline, virtual]
 

Check if seek functions are supported.

Returns:
true if seek functions are supported.

Implements bitreader.

Definition at line 110 of file bitreaders.hpp.

00110 { return true; }

char string_bitreader::read_next_byte  )  [inline, protected, virtual]
 

Defines the method of reading a single byte of input.

Derived classes must implement this function.

Returns:
the next byte (8 bits) from the input.

Implements bitreader.

Definition at line 114 of file bitreaders.hpp.

00114 { return s[index++]; }

void string_bitreader::set_position size_t  pos  )  [inline, protected, virtual]
 

Defines the method of setting the position for the next read.

Derived classes should implement this function if possible.

Parameters:
pos - the position for the next read.

Reimplemented from bitreader.

Definition at line 115 of file bitreaders.hpp.

00115 { index = pos; }


The documentation for this class was generated from the following file:  
Generated on 20 May 2004 by doxygen 1.3.3