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

Virtual base class for all readers. More...

#include <archon/util/stream.H>

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

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef C CharType

Public Member Functions

virtual int read (C *buffer, int size)=0 throw (ReadException, UnexpectedException)
 Read at most 'size' characters into 'buffer'.
int readAll (C *buffer, int size) throw (ReadException, UnexpectedException)
 Read until end-of-file is reached or 'size' characters have been read.
unsigned long getReadCount () const

Protected Member Functions

unsigned long getReadCountNoLock () const

Detailed Description

template<class C>
struct Archon::Utilities::Stream::ReaderBase< C >

Virtual base class for all readers.

Note:
The character type used as template argument 'C' must have default copy semantics like for std::string.

Definition at line 70 of file stream.H.


Member Function Documentation

template<class C>
virtual int Archon::Utilities::Stream::ReaderBase< C >::read C *  buffer,
int  size
throw (ReadException, UnexpectedException) [pure virtual]
 

Read at most 'size' characters into 'buffer'.

Returns:
The number of characters read. this will always be at least one unless end-of-file is reached or if size is zero

Implemented in Archon::Utilities::Stream::BasicPipe< C >, Archon::Utilities::Stream::StringReader, Archon::Utilities::Stream::FileReader, Archon::Utilities::Stream::Utf8StreamReader, Archon::Utilities::Stream::Utf8FileReader, Archon::Utilities::Stream::BasicRewindReader< C >, Archon::X3D::SAI::Reader, and Archon::Utilities::Stream::BasicPipe< char >.

Referenced by Archon::Utilities::Stream::ReaderBase< char >::readAll().

template<class C>
int Archon::Utilities::Stream::ReaderBase< C >::readAll C *  buffer,
int  size
throw (ReadException, UnexpectedException) [inline]
 

Read until end-of-file is reached or 'size' characters have been read.

Returns:
The number of characters read. Any value less than 'size' means that end-of-file has been reached.

Definition at line 91 of file stream.H.


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