Archon::Utilities::Stream::BasicRewindReader< C > Struct Template Reference

Create a stream reader with the ability to rewind to the beginning. More...

#include <archon/util/stream.H>

Inheritance diagram for Archon::Utilities::Stream::BasicRewindReader< C >:

Inheritance graph
[legend]
Collaboration diagram for Archon::Utilities::Stream::BasicRewindReader< C >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int read (C *buffer, int size) throw (ReadException, UnexpectedException)
void rewind ()
 Rewind to the start of the stream.
void release ()
 Give up the rewind capability from this point and on.

Static Public Member Functions

static Ref< BasicRewindReaderget (Ref< ReaderBase< C > > r)
 New RewindReaders are constructed with this method.

Detailed Description

template<typename C>
struct Archon::Utilities::Stream::BasicRewindReader< C >

Create a stream reader with the ability to rewind to the beginning.

This is usefull in situations such as when you must detect the MIME-type of the stream constents, and you must do this by asking various distinct systems to test for specific types.

The Image class uses this class to determine the image format of input streams.

See also:
Image

Definition at line 180 of file stream.H.


Member Function Documentation

template<typename C>
static Ref<BasicRewindReader> Archon::Utilities::Stream::BasicRewindReader< C >::get Ref< ReaderBase< C > >  r  )  [inline, static]
 

New RewindReaders are constructed with this method.

The real constructor is hidden to prevent creation of automatic variables of this type.

Definition at line 187 of file stream.H.

template<typename C>
void Archon::Utilities::Stream::BasicRewindReader< C >::release  )  [inline]
 

Give up the rewind capability from this point and on.

This should be done before reading the entire contents of the stream because the rewind capability requires every bit of retreived data to be stored in a buffer. After calling this method no new data will be buffered and when the current rewind buffer gets empty it will be deallocated.

Definition at line 208 of file stream.H.


The documentation for this struct was generated from the following file:
Generated on Sun Jul 30 22:58:18 2006 for Archon by  doxygen 1.4.4