chm::chmistream Class Reference

Inputstream for reading files inside a chm archives. More...

#include <chmxx.h>

List of all members.

Public Member Functions

 chmistream (const chmfile &chm, const std::string &path, size_t buf_size=1024)
 Create a new input stream from archive for given path.
std::streamsize read_left () const
 Returns the number of bytes that are left to be read from this stream.
virtual ~chmistream ()
size_t get_encint ()
 Get little endian MS encint from the stream.
unsigned long get_dword ()
 Get local endianized MS dword (2 x 2 bytes) from the stream.
unsigned int get_word ()
 Get local endianized MS word (2 bytes) from the stream.
unsigned long get_sr (int, int r, int &pos)
 Get a s-r encoded value from the stream.
void get_sr_finish (int &pos)


Detailed Description

Inputstream for reading files inside a chm archives.

        chm::chmfile chm("/chmfile.chm");
        chm::chmistream in(chm, "/path");
        string line;
        while ( readline(chm, line) ) {
            cout << line;
        }

Definition at line 148 of file chmxx.h.


Constructor & Destructor Documentation

chm::chmistream::chmistream ( const chmfile chm,
const std::string &  path,
size_t  buf_size = 1024 
)

Create a new input stream from archive for given path.

virtual chm::chmistream::~chmistream (  )  [virtual]


Member Function Documentation

std::streamsize chm::chmistream::read_left (  )  const

Returns the number of bytes that are left to be read from this stream.

So returns the size of file when nothing has been read.

size_t chm::chmistream::get_encint (  )  [inline]

Get little endian MS encint from the stream.

Definition at line 160 of file chmxx.h.

unsigned long chm::chmistream::get_dword (  )  [inline]

Get local endianized MS dword (2 x 2 bytes) from the stream.

Definition at line 176 of file chmxx.h.

unsigned int chm::chmistream::get_word (  )  [inline]

Get local endianized MS word (2 bytes) from the stream.

Definition at line 190 of file chmxx.h.

unsigned long chm::chmistream::get_sr ( int  ,
int  r,
int &  pos 
) [inline]

Get a s-r encoded value from the stream.

Scale must always be 2. Use 0 for initial pos. When finished reading an entry of sr-s call the get_sr_finish(pos).

Definition at line 203 of file chmxx.h.

void chm::chmistream::get_sr_finish ( int &  pos  )  [inline]

Definition at line 243 of file chmxx.h.


The documentation for this class was generated from the following file:
Copyright © 2003, 2008 Indrek Mandre