Logo Search packages:      
Sourcecode: xchm version File versions

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.

Definition at line 116 of file chminputstream.cpp.

References CHMFile::RetrieveObject().

{     
      if(_currPos >= (off_t)_ui.length) {
            m_lasterror = wxSTREAM_EOF;
            return 0;
      }

      if(!_archiveCache)
            return 0;

      if(_currPos + bufsize > (off_t)_ui.length)
        bufsize = _ui.length - _currPos;
        
      bufsize = 
            _archiveCache->RetrieveObject(&_ui,
                                    (unsigned char *)buffer, 
                                    _currPos, bufsize);
     
      _currPos += bufsize;
    
      return bufsize;
}


Generated by  Doxygen 1.6.0   Back to index