Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Core::StreamDecorator Class Reference

StreamDecorator is an abstract superclass for all classes that change any stream aspect eg. More...

#include <StreamDecorator.h>

Inheritance diagram for Core::StreamDecorator:

Inheritance graph
[legend]
Collaboration diagram for Core::StreamDecorator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StreamDecorator (Stream *stream)
virtual StreambasicStream (void)
virtual SequenceableCollectioncontents (void)
 Answer content of the receiver.
virtual void flush (void)
virtual long position (void)
virtual void position (long position)
virtual void reset (void)
virtual void skip (long length)
virtual void close (void)
virtual void commit (void)
virtual bool atEnd (void)
virtual bool basicAtEnd (void)
virtual bool isEmpty (void)
virtual bool notEmpty (void)
virtual bool isExternalStream (void)
virtual bool isReadable (void)
virtual bool isWritable (void)

Protected Member Functions

virtual SequenceableCollectioncontentSpeciesFor (long items) abstract

Protected Attributes

Streamunderlying_stream

Detailed Description

StreamDecorator is an abstract superclass for all classes that change any stream aspect eg.

character encoding or line end convention.

Definition at line 34 of file StreamDecorator.h.


Constructor & Destructor Documentation

Core::StreamDecorator::StreamDecorator Stream stream  ) 
 

Definition at line 28 of file StreamDecorator.cc.

References underlying_stream.

00029 {
00030     underlying_stream = stream;
00031 }


Member Function Documentation

bool Core::StreamDecorator::atEnd void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 82 of file StreamDecorator.cc.

References Core::Stream::atEnd(), and underlying_stream.

00083 {
00084     return underlying_stream->atEnd();
00085 }

bool Core::StreamDecorator::basicAtEnd void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 87 of file StreamDecorator.cc.

References Core::Stream::basicAtEnd(), and underlying_stream.

00088 {
00089     return underlying_stream->basicAtEnd();
00090 }

Stream * Core::StreamDecorator::basicStream void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 34 of file StreamDecorator.cc.

References Core::Stream::basicStream(), and underlying_stream.

00035 {
00036     return underlying_stream->basicStream();
00037 }

void Core::StreamDecorator::close void   )  [virtual]
 

Reimplemented from Core::Stream.

Reimplemented in Tools::LogWriter.

Definition at line 71 of file StreamDecorator.cc.

References Core::Stream::close(), and underlying_stream.

00072 {
00073     underlying_stream->close();
00074 }

void Core::StreamDecorator::commit void   )  [virtual]
 

Reimplemented from Core::Stream.

Reimplemented in Tools::LogWriter.

Definition at line 76 of file StreamDecorator.cc.

References Core::Stream::commit(), and underlying_stream.

00077 {
00078     underlying_stream->commit();
00079 }

SequenceableCollection * Core::StreamDecorator::contents void   )  [virtual]
 

Answer content of the receiver.

In many cases it doesn't matter if it is ReadStream or WriteStream because they don't do any conversion. I does matter on streams like EncodedStream where some conversion takes place. In that case contents() always answer collection of encoded data (for ex. as it would be written to the disk). To get all data decoded you can use upToEnd() method.

Reimplemented from Core::Stream.

Definition at line 39 of file StreamDecorator.cc.

References Core::Stream::contents(), and underlying_stream.

Referenced by Core::ByteArray::fromStringEncoding().

00040 {
00041     return underlying_stream->contents();
00042 }

virtual SequenceableCollection* Core::StreamDecorator::contentSpeciesFor long  items  )  [protected, virtual]
 

Reimplemented from Core::Stream.

Reimplemented in Core::EncodedStream, Core::LineEndConvertor, and Tools::LogWriter.

void Core::StreamDecorator::flush void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 44 of file StreamDecorator.cc.

References Core::Stream::flush(), and underlying_stream.

Referenced by Tools::LogWriter::commit().

00045 {
00046     underlying_stream->flush();
00047 }

bool Core::StreamDecorator::isEmpty void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 92 of file StreamDecorator.cc.

References Core::Stream::isEmpty(), and underlying_stream.

00093 {
00094     return underlying_stream->isEmpty();
00095 }

bool Core::StreamDecorator::isExternalStream void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 102 of file StreamDecorator.cc.

References Core::Stream::isExternalStream(), and underlying_stream.

00103 {
00104     return underlying_stream->isExternalStream();
00105 }

bool Core::StreamDecorator::isReadable void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 107 of file StreamDecorator.cc.

References Core::Stream::isReadable(), and underlying_stream.

00108 {
00109     return underlying_stream->isReadable();
00110 }

bool Core::StreamDecorator::isWritable void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 112 of file StreamDecorator.cc.

References Core::Stream::isWritable(), and underlying_stream.

00113 {
00114     return underlying_stream->isWritable();
00115 }

bool Core::StreamDecorator::notEmpty void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 97 of file StreamDecorator.cc.

References Core::Stream::notEmpty(), and underlying_stream.

00098 {
00099     return underlying_stream->notEmpty();
00100 }

void Core::StreamDecorator::position long  position  )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 55 of file StreamDecorator.cc.

References Core::Stream::position(), and underlying_stream.

00056 {
00057     underlying_stream->position(pos);
00058 }

long Core::StreamDecorator::position void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 50 of file StreamDecorator.cc.

References Core::Stream::position(), and underlying_stream.

00051 {
00052     return underlying_stream->position();
00053 }

void Core::StreamDecorator::reset void   )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 60 of file StreamDecorator.cc.

References Core::Stream::reset(), and underlying_stream.

00061 {
00062     underlying_stream->reset();
00063 }

void Core::StreamDecorator::skip long  length  )  [virtual]
 

Reimplemented from Core::Stream.

Definition at line 65 of file StreamDecorator.cc.

References Core::Stream::skip(), and underlying_stream.

00066 {
00067     underlying_stream->skip(length);
00068 }


Member Data Documentation

Stream* Core::StreamDecorator::underlying_stream [protected]
 

Definition at line 37 of file StreamDecorator.h.

Referenced by atEnd(), basicAtEnd(), basicStream(), close(), Tools::LogWriter::close(), commit(), Tools::LogWriter::commit(), contents(), flush(), isEmpty(), isExternalStream(), isReadable(), isWritable(), Tools::LogWriter::next(), Core::LineEndConvertor::next(), Core::EncodedStream::next(), Tools::LogWriter::nextPut(), Core::LineEndConvertor::nextPut(), Core::EncodedStream::nextPut(), notEmpty(), position(), reset(), skip(), and StreamDecorator().


The documentation for this class was generated from the following files:
Generated on Mon Nov 27 09:51:59 2006 for Smalltalk like C++ Class Library by  doxygen 1.4.2