Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

bool SymbianStdioStream::seek ( int32  offset,
int  whence = SEEK_SET 
) [virtual]

Sets the stream position indicator for the stream. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the seek() method clears the end-of-file indicator for the stream.

offsetthe relative offset in bytes
whencethe seek reference: SEEK_SET, SEEK_CUR, or SEEK_END
true on success, false in case of a failure

Implements Common::SeekableReadStream.

Definition at line 215 of file symbianstream.cpp.

References _handle, and pos().


      TSeek seekMode = ESeekStart;
      TInt pos = offs;
      TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle));

      switch (whence) {
      case SEEK_SET:
            seekMode = ESeekStart;
      case SEEK_CUR:
            seekMode = ESeekCurrent;
            if (entry->_inputPos != KErrNotFound) {
                  pos += (entry->_inputPos - entry->_inputBufferLen);
      case SEEK_END:
            seekMode = ESeekEnd;


      entry->_inputPos = KErrNotFound;
      entry->_eofReached = EFalse;
      entry->_fileHandle.Seek(seekMode, pos);

      return true;      // FIXME: Probably should return a value based on what _fileHandle.Seek returns

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index