Stream::MemoryBlockStream Class Reference

#include <Streams.hpp>

Inheritance diagram for Stream::MemoryBlockStream:

Stream::InputStream Stream::BaseStream List of all members.

Detailed Description

A buffered input stream based on a existing memory block.


Public Member Functions

virtual uint32 currentPosition () const
 This method returns the position of the next byte that could be read from this stream.
virtual bool endReached () const
 This method returns true if the end of stream is reached.
virtual uint32 fullSize () const
 This method returns the stream length in byte, if known If the length is equal or higher than 2^32 - 1, the returned value is 0xfffffffe.
const uint8 * getBuffer ()
 Get the buffer.
virtual bool goForward (const uint32 &skipAmount)
 Move the stream position forward of the given amount This should give the same results as setPosition(currentPosition() + value), but implementation can be faster for non-seek-able stream.
 MemoryBlockStream (const uint8 *data, const uint32 len)
 Construction from memory block (it's copied).
virtual uint32 read (void *const _buffer, const uint32 &size) const throw ()
 Try to read the given amount of data to the specified buffer.
virtual bool setPosition (const uint32 &newPos)
 Try to seek to the given absolute position (return false if not supported).
 ~MemoryBlockStream ()
 The only allowed destructor.


Constructor & Destructor Documentation

Stream::MemoryBlockStream::MemoryBlockStream ( const uint8 *  data,
const uint32  len 
) [inline]

Construction from memory block (it's copied).

Stream::MemoryBlockStream::~MemoryBlockStream (  )  [inline]

The only allowed destructor.


Member Function Documentation

virtual uint32 Stream::MemoryBlockStream::currentPosition (  )  const [inline, virtual]

This method returns the position of the next byte that could be read from this stream.

Implements Stream::BaseStream.

virtual bool Stream::MemoryBlockStream::endReached (  )  const [inline, virtual]

This method returns true if the end of stream is reached.

Implements Stream::BaseStream.

virtual uint32 Stream::MemoryBlockStream::fullSize (  )  const [inline, virtual]

This method returns the stream length in byte, if known If the length is equal or higher than 2^32 - 1, the returned value is 0xfffffffe.

Implements Stream::BaseStream.

const uint8* Stream::MemoryBlockStream::getBuffer (  )  [inline]

Get the buffer.

virtual bool Stream::MemoryBlockStream::goForward ( const uint32 &  skipAmount  )  [inline, virtual]

Move the stream position forward of the given amount This should give the same results as setPosition(currentPosition() + value), but implementation can be faster for non-seek-able stream.

Implements Stream::BaseStream.

virtual uint32 Stream::MemoryBlockStream::read ( void *const   _buffer,
const uint32 &  size 
) const throw () [inline, virtual]

Try to read the given amount of data to the specified buffer.

Returns:
the number of byte truly read (this method doesn't throw)

Implements Stream::InputStream.

virtual bool Stream::MemoryBlockStream::setPosition ( const uint32 &  newPos  )  [inline, virtual]

Try to seek to the given absolute position (return false if not supported).

Implements Stream::BaseStream.


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

(C) An X-Ryl669 project 2007

This document describes Unlimited Zooming Interface source code. UZI stands for Unlimited Zooming Interface, and source code license is