Location:
S32MEM.H
Link against: estor.lib
class TBufBuf : public TStreamBuf;
A stream buffer that uses a dynamic buffer for its implementation.
A stream of this type is used by RBufWriteStream
and RBufReadStream
objects. It also has intermediate buffering capabilities.
This is a seekable stream buffer.
There are three write modes:
insert mode - inserts new data into the buffer at the offset passed to Set()
overwrite mode - replaces the data in the buffer starting at the offset passed to Set()
. Once the end of the buffer is reached, it is automatically extended as more data is written. This is the default mode.
truncate mode - truncates the buffer to the offset passed to Set()
before data is written, extending the buffer. When writing, the buffer size as reported by CBufBase::Size()
may be larger than the data written to the stream. To synchronise the buffer's reported size with the stream, call the MStreamBuf::SynchL()
function.
Note that this object never takes ownership of the dynamic buffer, the CBufBase
type object.
MStreamBuf
- A stream buffer that provides a generic I/O interface for streamed data
TStreamBuf
- Adds buffering capabilities to a stream buffer
TBufBuf
- A stream buffer that uses a dynamic buffer for its implementation
Defined in TBufBuf
:
DoSeekL()
, DoSynchL()
, DoWriteL()
, EInsert
, ETruncate
, OverflowL()
, Set()
, TBufBuf()
, UnderflowL()
, anonymous
Inherited from MStreamBuf
:
Close()
,
DoRelease()
,
ERead
,
EWrite
,
PushL()
,
Read()
,
ReadL()
,
Release()
,
SeekL()
,
SizeL()
,
Synch()
,
SynchL()
,
TMark
,
TRead
,
TWrite
,
TellL()
,
Write()
,
WriteL()
Inherited from TStreamBuf
:
Avail()
,
DoReadL()
,
End()
,
Ptr()
,
SetBuf()
,
SetEnd()
,
SetPtr()
,
TArea
IMPORT_C void Set(CBufBase &aBuf, TInt aPos, TInt aMode=ERead|EWrite);
Sets up the stream to use the specified dynamic buffer.
|
protected: virtual IMPORT_C TInt UnderflowL(TInt aMaxLength);
Re-fills the intermediate buffer and resets the start and end points of the read area.
The implementation of this function depends on the way the stream itself is implemented. For example, the in-memory streams have simple implementations.
|
|
protected: virtual IMPORT_C void OverflowL();
Empties the intermediate buffer and resets the start and end points of the write area.
The implementation of this function depends on the way the stream itself is implemented. For example, the in-memory streams have simple implementations.
protected: virtual IMPORT_C void DoSynchL();
Synchronises the stream buffer with the stream, leaving if any error occurs.
In effect, this ensures that buffered data is delivered to the stream.
It is called by SynchL()
.
This implementation is empty, but classes derived from MStreamBuf
can provide their own implementation, if necessary.
protected: virtual IMPORT_C void DoWriteL(const TAny *aPtr, TInt aLength);
Writes data from the specified memory location into the intermediate buffer.
The function calls the virtual function OverfLowL() to give concrete implementations the chance to forward the intermediate buffer content to its destination.
This implementation overrides the one supplied by the base class MStreamBuf
, and is called by MStreamBuf::WriteL(const TAny*,TInt)
.
|
protected: virtual IMPORT_C TStreamPos DoSeekL(TMark aMark, TStreamLocation aLocation, TInt anOffset);
|
|