#include <IOBuffer.h>
Inheritance diagram for Core::IOBuffer:
Public Member Functions | |
IOBuffer (IOAccessor *accessor) | |
virtual String * | className (void) const |
Answer receiver class name. | |
virtual ByteArray * | buffer (void) |
virtual void | bufferChanged (void) |
virtual long | currentBufferPosition (void) |
virtual long | firstDataPosition (void) |
virtual long | lastDataPosition (void) |
virtual long | lastWriteablePosition (void) |
virtual bool | isSeekable (void) |
virtual ByteArray * | readPositionAndSetOffset (long position, long &offset) |
virtual ByteArray * | nextAndSetOffset (long &offset) |
virtual void | commit (void) |
virtual void | flushBufferUpTo (long position) |
virtual long | readBufferStartingAt (long position) |
virtual void | stepToNextBuffer (void) |
Protected Attributes | |
IOAccessor * | io_accessor |
ByteArray * | _buffer |
long | buffer_amount |
|
Definition at line 31 of file IOBuffer.cc. References _buffer, buffer_amount, Core::IOAccessor::bufferSize(), and io_accessor. 00032 { 00033 io_accessor = accessor; 00034 _buffer = new ByteArray(io_accessor->bufferSize()); 00035 buffer_amount = 0; 00036 }
|
|
Definition at line 45 of file IOBuffer.cc. References _buffer. Referenced by Core::ExternalStream::ExternalStream(), and Core::ExternalWriteStream::flush(). 00046 { 00047 return _buffer; 00048 }
|
|
Definition at line 51 of file IOBuffer.cc. Referenced by Core::ExternalWriteStream::flush(). 00052 {
00053 /* Does nothing */
00054 }
|
|
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::Object. Definition at line 39 of file IOBuffer.cc. 00040 { 00041 return new String("IOBuffer"); 00042 }
|
|
Definition at line 105 of file IOBuffer.cc. References Core::IOAccessor::commit(), and io_accessor. Referenced by Core::ExternalStream::commit(). 00106 { 00107 io_accessor->commit(); 00108 }
|
|
Definition at line 57 of file IOBuffer.cc. Referenced by Core::ExternalStream::readPosition(). 00058 {
00059 return 0;
00060 }
|
|
Definition at line 62 of file IOBuffer.cc. Referenced by Core::ExternalStream::ExternalStream(), and Core::ExternalWriteStream::flush(). 00063 {
00064 return 0;
00065 }
|
|
Definition at line 111 of file IOBuffer.cc. References _buffer, io_accessor, and Core::IOAccessor::writeForSureFrom(). Referenced by Core::ExternalWriteStream::flush(). 00112 { 00113 if (position > 0) 00114 io_accessor->writeForSureFrom(_buffer, 0, position); 00115 }
|
|
Definition at line 78 of file IOBuffer.cc. References io_accessor, and Core::IOAccessor::isSeekable(). Referenced by Core::ExternalReadStream::skip(). 00079 { 00080 return io_accessor->isSeekable(); 00081 }
|
|
Definition at line 67 of file IOBuffer.cc. References buffer_amount. Referenced by Core::ExternalStream::nextBuffer(), and Core::ExternalStream::setPosition(). 00068 { 00069 return buffer_amount; 00070 }
|
|
Definition at line 72 of file IOBuffer.cc. References _buffer, and Core::ByteArray::size(). Referenced by Core::ExternalWriteStream::nextPut().
|
|
Definition at line 92 of file IOBuffer.cc. References _buffer, buffer_amount, readBufferStartingAt(), Core::ByteArray::size(), and stepToNextBuffer(). Referenced by Core::ExternalStream::nextBuffer(). 00093 { 00094 long amt, start; 00095 00096 stepToNextBuffer(); 00097 start = buffer_amount % _buffer->size(); 00098 amt = readBufferStartingAt(start); 00099 offset = start; 00100 buffer_amount = start + amt; 00101 return _buffer; 00102 }
|
|
Definition at line 118 of file IOBuffer.cc. References _buffer, io_accessor, Core::IOAccessor::readInto(), and Core::ByteArray::size(). Referenced by nextAndSetOffset(), and readPositionAndSetOffset(). 00119 { 00120 long amt; 00121 amt = _buffer->size() - position; 00122 amt = io_accessor->readInto(_buffer, position, amt); 00123 /* Tady by se mely osetrit chyby cteni. */ 00124 return amt; 00125 }
|
|
Definition at line 83 of file IOBuffer.cc. References _buffer, buffer_amount, io_accessor, readBufferStartingAt(), and Core::IOAccessor::seekTo(). Referenced by Core::ExternalStream::setPosition(). 00084 { 00085 io_accessor->seekTo(position); 00086 buffer_amount = readBufferStartingAt(1); 00087 offset = 1; 00088 return _buffer; 00089 }
|
|
Definition at line 127 of file IOBuffer.cc. Referenced by nextAndSetOffset(). 00128 {
00129 /* Does nothing */
00130 }
|
|
Definition at line 38 of file IOBuffer.h. Referenced by buffer(), flushBufferUpTo(), IOBuffer(), lastWriteablePosition(), nextAndSetOffset(), readBufferStartingAt(), and readPositionAndSetOffset(). |
|
Definition at line 39 of file IOBuffer.h. Referenced by IOBuffer(), lastDataPosition(), nextAndSetOffset(), and readPositionAndSetOffset(). |
|
Definition at line 37 of file IOBuffer.h. Referenced by commit(), flushBufferUpTo(), IOBuffer(), isSeekable(), readBufferStartingAt(), and readPositionAndSetOffset(). |