ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Common::SafeSeekableSubReadStream Class Reference

A seekable substream that removes the exclusivity demand required by the normal SeekableSubReadStream, at the cost of seek()ing the parent stream before each read(). More...

#include <substream.h>

Inheritance diagram for Common::SafeSeekableSubReadStream:
Collaboration diagram for Common::SafeSeekableSubReadStream:

List of all members.

Public Member Functions

 SafeSeekableSubReadStream (SeekableReadStream *parentStream, uint32 begin, uint32 end, DisposeAfterUse::Flag disposeParentStream=DisposeAfterUse::NO)
virtual uint32 read (void *dataPtr, uint32 dataSize)
 Read data from the stream.

Detailed Description

A seekable substream that removes the exclusivity demand required by the normal SeekableSubReadStream, at the cost of seek()ing the parent stream before each read().

More than one SafeSeekableSubReadStream to the same parent stream can be used at the same time; they won't mess up each other. They will, however, reposition the parent stream, so don't depend on its position to be the same after a read() or seek() on one of its SafeSeekableSubReadStream.

Note that this stream is *not* threading safe. Calling read from the audio thread and from the main thread might mess up the data retrieved.

Definition at line 110 of file substream.h.


Constructor & Destructor Documentation

Common::SafeSeekableSubReadStream::SafeSeekableSubReadStream ( SeekableReadStream parentStream,
uint32  begin,
uint32  end,
DisposeAfterUse::Flag  disposeParentStream = DisposeAfterUse::NO 
) [inline]

Definition at line 112 of file substream.h.


Member Function Documentation

uint32 Common::SafeSeekableSubReadStream::read ( void *  dataPtr,
uint32  dataSize 
) [virtual]

Read data from the stream.

Subclasses must implement this method; all other read methods are implemented using it.

Note:
The semantics of any implementation of this method are supposed to match those of ISO C fread(), in particular where it concerns setting error and end of file/stream flags.
Parameters:
dataPtr pointer to a buffer into which the data is read
dataSize number of bytes to be read
Returns:
the number of bytes which were actually read.

Implements Common::ReadStream.

Definition at line 264 of file stream.cpp.


The documentation for this class was generated from the following files:


Generated on Sat Jan 12 2019 05:04:17 for ResidualVM by doxygen 1.7.1
curved edge   curved edge