Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

CHMInputStream Class Reference

Input stream from a .chm archive. More...

#include <chminputstream.h>

Inheritance diagram for CHMInputStream:

wxInputStream List of all members.

Public Member Functions

 CHMInputStream (const wxString &archive, const wxString &file)
 Creates a stream.
virtual size_t GetSize () const
 Returns the size of the file.
virtual bool Eof () const
 True if EOF has been found.

Static Public Member Functions

static CHMFileGetCache ()
 Returns the static CHMFile pointer associated with this stream. Archives are being cached until it is explicitly requested to open a different one.
static void Cleanup ()
 Cleans up the cache. Has to be public and static since the stream doesn't know how many other streams using the same cache will be created after it. Somebody else has to turn off the lights, and in this case it's CHMFSHandler.

Protected Member Functions

virtual size_t OnSysRead (void *buffer, size_t bufsize)
 Attempts to read a chunk from the stream.
virtual off_t OnSysSeek (off_t seek, wxSeekMode mode)
 Seeks to the requested position in the file.
virtual off_t OnSysTell () const
 Asks what is the current position in the file.

Private Member Functions

bool Init (const wxString &archive)
 Helper. Inits the cache.

Private Attributes

off_t _currPos
chmUnitInfo _ui

Static Private Attributes

static CHMFile_archiveCache = NULL
static wxString _path

Detailed Description

Input stream from a .chm archive.


Constructor & Destructor Documentation

CHMInputStream::CHMInputStream const wxString &  archive,
const wxString &  file
 

Creates a stream.

Parameters:
archive The .chm file name on disk. It makes sense to pass the empty string if you're sure file is a link to a page, in the form of "/MS-ITS:archive.chm::/filename.html".
file The file requested from the archive.


Member Function Documentation

CHMFile * CHMInputStream::GetCache  )  [static]
 

Returns the static CHMFile pointer associated with this stream. Archives are being cached until it is explicitly requested to open a different one.

Returns:
A valid pointer to a CHMFile object or NULL if no .chm file has been opened yet.

size_t CHMInputStream::OnSysRead void *  buffer,
size_t  bufsize
[protected, virtual]
 

Attempts to read a chunk from the stream.

Parameters:
buffer The read data is being placed here.
bufsize Number of bytes requested.
Returns:
Number of bytes actually read.

off_t CHMInputStream::OnSysSeek off_t  seek,
wxSeekMode  mode
[protected, virtual]
 

Seeks to the requested position in the file.

Parameters:
seek Where to seek.
mode Seek from the beginning, current position, etc.
Returns:
Position in the file.

virtual off_t CHMInputStream::OnSysTell  )  const [inline, protected, virtual]
 

Asks what is the current position in the file.

Returns:
Current position.


The documentation for this class was generated from the following files:
Generated on Mon Feb 21 11:08:38 2005 for xCHM by  doxygen 1.4.0