|
||
class TStreamBuf : public MStreamBuf;
Adds buffering capabilities to a stream buffer
The class provides pointers to mark out the current read and write areas within the intermediate buffer. The class also defines
the pure virtual functions TStreamBuf::UnderflowL(TInt)
and TStreamBuf::OverflowL()
which must be provided by a derived class.
Streams which have buffering capabilities derive from this class, otherwise they derive from MStreamBuf
.
Note that the class does not provide the buffer; this is left to the class derived from it. For example, the memory buffer classes use the memory area directly, the file buffer class allocate a heap cell to use as a buffer.
MStreamBuf
-
A stream buffer that provides a generic I/O interface for streamed data.
TStreamBuf
-
Adds buffering capabilities to a stream buffer
Defined in 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)
DoWriteL(const TAny *,TInt)
Writes data from the specified memory location into the intermediate buffer.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.OverflowL()
Empties the intermediate buffer and resets the start and end points of the write...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.TStreamBuf()
Sets the pointers that mark out the read and write areas within the intermediate...UnderflowL(TInt)
Re-fills the intermediate buffer and resets the start and end points of the read...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...TStreamBuf::UnderflowL(TInt)
Re-fills the intermediate buffer and resets the start and end points of the read...TStreamBuf::OverflowL()
Empties the intermediate buffer and resets the start and end points of the write...protected: IMPORT_C TStreamBuf();
Sets the pointers that mark out the read and write areas within the intermediate buffer to null.
protected: IMPORT_C void SetBuf(TArea anArea, TUint8 *aPtr, TUint8 *anEnd);
Sets the start and end points of the read and/or the write area within the intermediate buffer.
A start point is always within an area; an end point is always the first byte beyond the end of an area.
|
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 void SetPtr(TArea anArea, TUint8 *aPtr);
Sets the start point of the read and/or the write area within the intermediate buffer.
A start point is always within an area.
|
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 void SetEnd(TArea anArea, TUint8 *anEnd);
|
protected: IMPORT_C TUint8* Ptr(TArea anArea) const;
Gets the current start point of the read or write area within the intermediate 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 TUint8* End(TArea anArea) const;
Gets the current end point of the read or write area within the intermediate buffer.
An end point is always the first byte beyond the end of an area.
|
|
protected: IMPORT_C TInt Avail(TArea anArea) const;
Gets the number of bytes available in the read or write area within the intermediate buffer.
|
|
protected: IMPORT_C virtual TInt DoReadL(TAny *aPtr, TInt aMaxLength);
Reads data from the intermediate buffer into the specified memory location.
The function calls the virtual function UnderfLowL() to give concrete implementations the chance to refill the intermediate buffer, and satisfy the caller's requirements.
This implementation overrides the one supplied by the base class MStreamBuf
, and is called by, MStreamBuf::ReadL(TAny *,TInt)
.
|
|
MStreamBuf::ReadL(TAny *,TInt)
Reads data from the stream buffer into the specified memory location.MStreamBuf::DoReadL(TAny *,TInt)
protected: IMPORT_C virtual TStreamTransfer DoReadL(MStreamInput &anInput, TStreamTransfer aTransfer);
Reads data from the intermediate buffer and, if necessary, any remaining data from the stream to the specified target stream input object.
It is called by MStreamBuf::ReadL(MStreamInput &,TStreamTransfer)
.
The intermediate buffer is emptied first by calling the target stream input's MStreamBuf::PushL()
function, which performs the read from intermediate buffer operation. Any remaining data is then read from the stream by
calling the target stream object's ReadFromL() function, which performs the read from stream operation.
This implementation is called for streams that have buffering capabilities and are derived from this class.
|
|
MStreamInput::ReadFromL(MStreamBuf &,TStreamTransfer)
Reads data from the specified stream into this stream input object.MStreamInput::PushL(const TAny *,TInt)
Reads data from an intermediate buffer into this stream input object.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 TStreamTransfer DoWriteL(MStreamOutput &anOutput, TStreamTransfer aTransfer);
|
|
protected: inline void SetBuf(TRead, TUint8 *aPtr, TUint8 *anEnd);
Sets the start and end points of the read area within the intermediate buffer.
A start point is always within an area; an end point is always the first byte beyond the end of an area.
|
MStreamBuf::TRead
Indicates that an operation applies to the read mark in a stream or to the read ...protected: inline void SetBuf(TWrite, TUint8 *aPtr, TUint8 *anEnd);
Sets the start and end points of the write area within the intermediate buffer.
A start point is always within an area; an end point is always the first byte beyond the end of an area.
|
MStreamBuf::TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...protected: inline void SetPtr(TRead, TUint8 *aPtr);
Sets the start point of the write area within the intermediate buffer.
A start point is always within an area.
|
MStreamBuf::TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...protected: inline void SetPtr(TWrite, TUint8 *aPtr);
Sets the start point of the write area within the intermediate buffer.
A start point is always within an area.
|
MStreamBuf::TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...protected: inline void SetEnd(TRead, TUint8 *anEnd);
|
protected: inline void SetEnd(TWrite, TUint8 *anEnd);
|
protected: inline TUint8* Ptr(TRead) const;
Gets the current start point of the read area within the intermediate buffer.
|
|
MStreamBuf::TRead
Indicates that an operation applies to the read mark in a stream or to the read ...protected: inline TUint8* Ptr(TWrite) const;
Gets the current start point of the write area within the intermediate buffer.
|
|
MStreamBuf::TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...protected: inline TUint8* End(TRead) const;
Gets the current end point of the read area within the intermediate buffer.
An end point is always the first byte beyond the end of an area.
|
|
MStreamBuf::TRead
Indicates that an operation applies to the read mark in a stream or to the read ...protected: inline TUint8* End(TWrite) const;
Gets the current end point of the write area within the intermediate buffer.
An end point is always the first byte beyond the end of an area.
|
|
MStreamBuf::TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...protected: inline TInt Avail(TRead) const;
Gets the number of bytes available in the read area within the intermediate buffer.
|
|
MStreamBuf::TRead
Indicates that an operation applies to the read mark in a stream or to the read ...protected: inline TInt Avail(TWrite) const;
Gets the number of bytes available in the write area within the intermediate buffer.
|
|
MStreamBuf::TWrite
Indicates that an operation applies to the write mark in a stream or to the writ...private: virtual TInt UnderflowL(TInt aMaxLength)=0;
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.
|
|
private: virtual void OverflowL()=0;
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: typedef TInt TStreamBuf::TArea;
Used to identify the type of area within an intermediate buffer.
The type is used by functions of this class that set or get pointers into the intermediate buffer.
The type uses the ERead and EWrite enumeration values, as bit flags, to identify the read and write areas respectively.
ERead is an MStreamBuf::TRead
enumerator. EWrite is an MStreamBuf::EWrite
enumerator.
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...