#include <ExternalReadStream.h>
Inheritance diagram for Core::ExternalReadStream:
Public Member Functions | |
ExternalReadStream (IOAccessor *accessor) | |
virtual String * | className (void) const |
Answer receiver class name. | |
virtual void | flush (void) |
virtual Object * | next (void) |
virtual SequenceableCollection * | next (long items) |
virtual void | nextPut (Object *object) |
virtual void | nextPut (const char object) |
virtual void | skip (long length) |
virtual bool | isReadable (void) |
virtual bool | isWritable (void) |
|
Definition at line 31 of file ExternalReadStream.cc. 00032 : ExternalStream(accessor) 00033 { 00034 /* Does nothing */ 00035 }
|
|
Answer receiver class name. Because there isn't any standard way to obtain class name this method comes to place. Every class should rewrite this method but many didn't (yet). Reimplemented from Core::ExternalStream. Reimplemented in Core::ExternalReadAppendStream. Definition at line 38 of file ExternalReadStream.cc. 00039 { 00040 return new String("ExternalReadStream"); 00041 }
|
|
Reimplemented from Core::Stream. Reimplemented in Core::ExternalReadAppendStream. Definition at line 44 of file ExternalReadStream.cc. 00045 {
00046 /* Does nothing */
00047 }
|
|
Reimplemented from Core::Stream. Definition at line 90 of file ExternalReadStream.cc. 00091 { 00092 return true; 00093 }
|
|
Reimplemented from Core::Stream. Reimplemented in Core::ExternalReadAppendStream. Definition at line 95 of file ExternalReadStream.cc. 00096 { 00097 return false; 00098 }
|
|
Reimplemented from Core::PositionableStream. Definition at line 45 of file ExternalReadStream.h. References Core::PositionableStream::next(). 00046 { return ExternalStream::next(items); }
|
|
Reimplemented from Core::PositionableStream. Definition at line 49 of file ExternalReadStream.cc. References Core::PositionableStream::_position, Core::SequenceableCollection::at(), Core::PositionableStream::collection, nil, Core::ExternalStream::pastEnd(), and Core::PositionableStream::read_limit. Referenced by skip(). 00050 { 00051 Object *ch; 00052 00053 if (_position >= read_limit) { 00054 ch = pastEnd(); 00055 if (ch == nil) return nil; 00056 } else { 00057 ch = collection->at(_position++); 00058 } 00059 return ch; 00060 }
|
|
Reimplemented from Core::Stream. Reimplemented in Core::ExternalReadAppendStream. Definition at line 48 of file ExternalReadStream.h. References Core::Stream::nextPut(). 00049 { ExternalStream::nextPut(object); }
|
|
Reimplemented from Core::Stream. Reimplemented in Core::ExternalReadAppendStream. Definition at line 62 of file ExternalReadStream.cc. References Core::Object::shouldNotImplement(). 00063 { 00064 shouldNotImplement(new String(__PRETTY_FUNCTION__)); 00065 }
|
|
Reimplemented from Core::PositionableStream. Definition at line 68 of file ExternalReadStream.cc. References Core::PositionableStream::_position, Core::ExternalStream::io_buffer, Core::IOBuffer::isSeekable(), next(), Core::PositionableStream::read_limit, Core::ExternalStream::readPosition(), and Core::ExternalStream::setPosition(). 00069 { 00070 long pos; 00071 00072 pos = _position + n; 00073 if (pos >= 0 && pos <= read_limit) 00074 _position = pos; 00075 else { 00076 if (io_buffer->isSeekable()) 00077 setPosition(readPosition() + n); 00078 else { 00079 if (n > 0) next(n); 00080 else { 00081 /* Cannot move back on unseekable stream. 00082 May raise an exception here. 00083 */ 00084 } 00085 } 00086 } 00087 }
|