![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
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 TBufBuf::Set(CBufBase &,TInt,TInt)
overwrite mode - replaces the data in the buffer starting at the offset passed to TBufBuf::Set(CBufBase &,TInt,TInt)
. 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 TBufBuf::Set(CBufBase &,TInt,TInt)
before data is written, extending the buffer. When writing, the buffer size as reported by CBufBase::Size()const
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(TMark,TStreamLocation,TInt)
DoSynchL()
Synchronises the stream buffer with the stream, leaving if any error occurs.DoWriteL(const TAny *,TInt)
Writes data from the specified memory location into the intermediate buffer.EInsert
ETruncate
OverflowL()
Empties the intermediate buffer and resets the start and end points of the write...Set(CBufBase &,TInt,TInt)
Sets up the stream to use the specified dynamic buffer.TBufBuf()
Constructs an empty object.UnderflowL(TInt)
Re-fills the intermediate buffer and resets the start and end points of the read...anonymous
Inherited from MStreamBuf
:
Close()
Closes the stream buffer.ERead
EWrite
PushL()
Puts a cleanup item for this object onto the cleanup stack.Read(TDes8 &,TInt,TRequestStatus &)
Reads data, asynchronously, from the stream buffer into the specified descriptor...Read(TDes8 &,TRequestStatus &)
Reads data, asynchronously, from the stream buffer into the specified descriptor...ReadL(MStreamInput &)
Reads data from the stream buffer into the specified data sink.ReadL(MStreamInput &,TInt)
Reads data from the stream buffer into the specified data sink.ReadL(MStreamInput &,TStreamTransfer)
Reads data from the stream buffer into the specified data sink.ReadL(TAny *,TInt)
Reads data from the stream buffer into the specified memory location.ReadL(TDes8 &,TInt,TRequestStatus &)
Reads data, asynchronously, from the stream buffer into the specified descriptor...ReadL(TDes8 &,TRequestStatus &)
Reads data, asynchronously, from the stream buffer into the specified descriptor...Release()
Frees resources before abandoning the stream buffer.SeekL(TMark,TStreamLocation,TInt)
Moves the position of the read mark or the write mark in the stream.SeekL(TMark,TStreamPos)
Moves the position of the read or write mark in the stream.SeekL(TRead,TInt)
Moves the position of the read mark in the stream by the specified offset.SeekL(TRead,TStreamLocation,TInt)
Moves the position of the read mark in the stream.SeekL(TWrite,TInt)
Moves the position of the write mark in the stream by the specified offset.SeekL(TWrite,TStreamLocation,TInt)
Moves the position of the write mark in the stream.SizeL()const
Gets the size of the stream.Synch()
Synchronises the stream buffer with the stream, returning any error.SynchL()
Synchronises the stream buffer with the stream, leaving if any error occurs.TMark
Used to identify the type of mark in a stream.TRead
Indicates that an operation applies to the read mark in a stream or to the read ...TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...TellL(TRead)const
Gets the position of the read mark within the stream.TellL(TWrite)const
Gets the position of the write mark within the stream.Write(const TDesC8 &,TInt,TRequestStatus &)
Write(const TDesC8 &,TRequestStatus &)
Writes data, asynchronously, from the specified descriptor into the stream buffe...WriteL(MStreamOutput &)
Writes data into the stream buffer from the specified data source.WriteL(MStreamOutput &,TInt)
Writes data into the stream buffer from the specified data source.WriteL(MStreamOutput &,TStreamTransfer)
Writes data into the stream buffer from the specified data source.WriteL(const TAny *,TInt)
Writes data from the specified memory location into the stream buffer.WriteL(const TDesC8 &,TInt,TRequestStatus &)
Writes data, asynchronously, from the specified descriptor into the stream buffe...WriteL(const TDesC8 &,TRequestStatus &)
Writes data, asynchronously, from the specified descriptor into the stream buffe...Inherited from TStreamBuf
:
Avail(TArea)const
Gets the number of bytes available in the read or write area within the intermed...Avail(TRead)const
Gets the number of bytes available in the read area within the intermediate buff...Avail(TWrite)const
Gets the number of bytes available in the write area within the intermediate buf...DoReadL(MStreamInput &,TStreamTransfer)
Reads data from the intermediate buffer and, if necessary, any remaining data fr...DoReadL(TAny *,TInt)
Reads data from the intermediate buffer into the specified memory location.DoWriteL(MStreamOutput &,TStreamTransfer)
End(TArea)const
Gets the current end point of the read or write area within the intermediate buf...End(TRead)const
Gets the current end point of the read area within the intermediate buffer.End(TWrite)const
Gets the current end point of the write area within the intermediate buffer.Ptr(TArea)const
Gets the current start point of the read or write area within the intermediate b...Ptr(TRead)const
Gets the current start point of the read area within the intermediate buffer.Ptr(TWrite)const
Gets the current start point of the write area within the intermediate buffer.SetBuf(TArea,TUint8 *,TUint8 *)
Sets the start and end points of the read and/or the write area within the inter...SetBuf(TRead,TUint8 *,TUint8 *)
Sets the start and end points of the read area within the intermediate buffer.SetBuf(TWrite,TUint8 *,TUint8 *)
Sets the start and end points of the write area within the intermediate buffer.SetEnd(TArea,TUint8 *)
SetEnd(TRead,TUint8 *)
SetEnd(TWrite,TUint8 *)
SetPtr(TArea,TUint8 *)
Sets the start point of the read and/or the write area within the intermediate b...SetPtr(TRead,TUint8 *)
Sets the start point of the write area within the intermediate buffer.SetPtr(TWrite,TUint8 *)
Sets the start point of the write area within the intermediate buffer.TArea
Used to identify the type of area within an intermediate buffer.CBufBase::Size()const
Gets the number of data bytes in the buffer.MStreamBuf::SynchL()
Synchronises the stream buffer with the stream, leaving if any error occurs.IMPORT_C TBufBuf();
Constructs an empty object.
Call TBufBuf::Set(CBufBase &,TInt,TInt)
before using the object.
IMPORT_C void Set(CBufBase &aBuf, TInt aPos, TInt aMode=ERead|EWrite);
Sets up the stream to use the specified dynamic buffer.
|
MStreamBuf::TRead
Indicates that an operation applies to the read mark in a stream or to the read ...MStreamBuf::TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...protected: IMPORT_C virtual 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: IMPORT_C virtual 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: IMPORT_C virtual 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 MStreamBuf::SynchL()
.
This implementation is empty, but classes derived from MStreamBuf
can provide their own implementation, if necessary.
MStreamBuf::SynchL()
Synchronises the stream buffer with the stream, leaving if any error occurs.protected: IMPORT_C virtual 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)
.
|
MStreamBuf::WriteL(const TAny *,TInt)
Writes data from the specified memory location into the stream buffer.MStreamBuf::DoWriteL(const TAny *,TInt)
protected: IMPORT_C virtual TStreamPos DoSeekL(TMark aMark, TStreamLocation aLocation, TInt anOffset);
|
|