TStreamBuf Class Reference

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 UnderflowL() and 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.

UnderflowL()

OverflowL()

Inherits from

Protected Member Functions
TStreamBuf()
IMPORT_C TIntAvail(TArea)
TInt Avail(TRead)
TInt Avail(TWrite)
IMPORT_C TIntDoReadL(TAny *, TInt)
IMPORT_C TStreamTransferDoReadL(MStreamInput &, TStreamTransfer)
IMPORT_C voidDoWriteL(const TAny *, TInt)
IMPORT_C TStreamTransferDoWriteL(MStreamOutput &, TStreamTransfer)
IMPORT_C TUint8 *End(TArea)
TUint8 *End(TRead)
TUint8 *End(TWrite)
IMPORT_C TUint8 *Ptr(TArea)
TUint8 *Ptr(TRead)
TUint8 *Ptr(TWrite)
IMPORT_C voidSetBuf(TArea, TUint8 *, TUint8 *)
voidSetBuf(TRead, TUint8 *, TUint8 *)
voidSetBuf(TWrite, TUint8 *, TUint8 *)
IMPORT_C voidSetEnd(TArea, TUint8 *)
voidSetEnd(TRead, TUint8 *)
voidSetEnd(TWrite, TUint8 *)
IMPORT_C voidSetPtr(TArea, TUint8 *)
voidSetPtr(TRead, TUint8 *)
voidSetPtr(TWrite, TUint8 *)
Private Member Functions
voidOverflowL()
TInt UnderflowL(TInt)
Inherited Functions
MStreamBuf::Close()
MStreamBuf::MStreamBuf()
MStreamBuf::PushL()
MStreamBuf::Read(TDes8 &,TInt,TRequestStatus &)
MStreamBuf::Read(TDes8 &,TRequestStatus &)
MStreamBuf::ReadL(MStreamInput &)
MStreamBuf::ReadL(MStreamInput &,TInt)
MStreamBuf::ReadL(MStreamInput &,TStreamTransfer)
MStreamBuf::ReadL(TAny *,TInt)
MStreamBuf::ReadL(TDes8 &,TInt,TRequestStatus &)
MStreamBuf::ReadL(TDes8 &,TRequestStatus &)
MStreamBuf::Release()
MStreamBuf::SeekL(TMark,TStreamLocation,TInt)
MStreamBuf::SeekL(TMark,TStreamPos)
MStreamBuf::SeekL(TRead,TInt)
MStreamBuf::SeekL(TRead,TStreamLocation,TInt)
MStreamBuf::SeekL(TWrite,TInt)
MStreamBuf::SeekL(TWrite,TStreamLocation,TInt)
MStreamBuf::SizeL()const
MStreamBuf::Synch()
MStreamBuf::SynchL()
MStreamBuf::TellL(TRead)const
MStreamBuf::TellL(TWrite)const
MStreamBuf::Write(const TDesC8 &,TInt,TRequestStatus &)
MStreamBuf::Write(const TDesC8 &,TRequestStatus &)
MStreamBuf::WriteL(MStreamOutput &)
MStreamBuf::WriteL(MStreamOutput &,TInt)
MStreamBuf::WriteL(MStreamOutput &,TStreamTransfer)
MStreamBuf::WriteL(const TAny *,TInt)
MStreamBuf::WriteL(const TDesC8 &,TInt,TRequestStatus &)
MStreamBuf::WriteL(const TDesC8 &,TRequestStatus &)
Inherited Enumerations
MStreamBuf:TRead
MStreamBuf:TWrite
Protected Member Type Definitions
typedef TInt TArea
Private Attributes
TUint8 *iREnd
TUint8 *iRPtr
TUint8 *iWEnd
TUint8 *iWPtr

Constructor & Destructor Documentation

TStreamBuf()

IMPORT_CTStreamBuf()[protected]

Member Functions Documentation

Avail(TArea)

IMPORT_C TIntAvail(TAreaanArea)const [protected]

Parameters

TArea anArea

Avail(TRead)

TInt Avail(TRead)const [protected, inline]

Gets the number of bytes available in the read area within the intermediate buffer.

The number of bytes available.

MStreamBuf::TRead

Parameters

TRead

Avail(TWrite)

TInt Avail(TWrite)const [protected, inline]

Gets the number of bytes available in the write area within the intermediate buffer.

The number of bytes available.

MStreamBuf::TWrite

Parameters

TWrite

DoReadL(TAny *, TInt)

IMPORT_C TIntDoReadL(TAny *aPtr,
TIntaMaxLength
)[protected, virtual]

Parameters

TAny * aPtr
TInt aMaxLength

DoReadL(MStreamInput &, TStreamTransfer)

IMPORT_C TStreamTransferDoReadL(MStreamInput &anInput,
TStreamTransferaTransfer
)[protected, virtual]

Parameters

MStreamInput & anInput
TStreamTransfer aTransfer

DoWriteL(const TAny *, TInt)

IMPORT_C voidDoWriteL(const TAny *aPtr,
TIntaLength
)[protected, virtual]

Parameters

const TAny * aPtr
TInt aLength

DoWriteL(MStreamOutput &, TStreamTransfer)

IMPORT_C TStreamTransferDoWriteL(MStreamOutput &anOutput,
TStreamTransferaTransfer
)[protected, virtual]

Parameters

MStreamOutput & anOutput
TStreamTransfer aTransfer

End(TArea)

IMPORT_C TUint8 *End(TAreaanArea)const [protected]

Parameters

TArea anArea

End(TRead)

TUint8 *End(TRead)const [protected, inline]

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.

The end point.

MStreamBuf::TRead

Parameters

TRead

End(TWrite)

TUint8 *End(TWrite)const [protected, inline]

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.

The end point.

MStreamBuf::TWrite

Parameters

TWrite

OverflowL()

voidOverflowL()[private, pure virtual]

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.

Ptr(TArea)

IMPORT_C TUint8 *Ptr(TAreaanArea)const [protected]

Parameters

TArea anArea

Ptr(TRead)

TUint8 *Ptr(TRead)const [protected, inline]

Gets the current start point of the read area within the intermediate buffer.

The start point.

MStreamBuf::TRead

Parameters

TRead

Ptr(TWrite)

TUint8 *Ptr(TWrite)const [protected, inline]

Gets the current start point of the write area within the intermediate buffer.

The start point.

MStreamBuf::TWrite

Parameters

TWrite

SetBuf(TArea, TUint8 *, TUint8 *)

IMPORT_C voidSetBuf(TAreaanArea,
TUint8 *aPtr,
TUint8 *anEnd
)[protected]

Parameters

TArea anArea
TUint8 * aPtr
TUint8 * anEnd

SetBuf(TRead, TUint8 *, TUint8 *)

voidSetBuf(TRead,
TUint8 *aPtr,
TUint8 *anEnd
)[protected, inline]

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

Parameters

TRead
TUint8 * aPtrThe start point.
TUint8 * anEndThe end point.

SetBuf(TWrite, TUint8 *, TUint8 *)

voidSetBuf(TWrite,
TUint8 *aPtr,
TUint8 *anEnd
)[protected, inline]

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

Parameters

TWrite
TUint8 * aPtrThe start point.
TUint8 * anEndThe end point.

SetEnd(TArea, TUint8 *)

IMPORT_C voidSetEnd(TAreaanArea,
TUint8 *anEnd
)[protected]

Parameters

TArea anArea
TUint8 * anEnd

SetEnd(TRead, TUint8 *)

voidSetEnd(TRead,
TUint8 *anEnd
)[protected, inline]

Parameters

TRead
TUint8 * anEnd

SetEnd(TWrite, TUint8 *)

voidSetEnd(TWrite,
TUint8 *anEnd
)[protected, inline]

Parameters

TWrite
TUint8 * anEnd

SetPtr(TArea, TUint8 *)

IMPORT_C voidSetPtr(TAreaanArea,
TUint8 *aPtr
)[protected]

Parameters

TArea anArea
TUint8 * aPtr

SetPtr(TRead, TUint8 *)

voidSetPtr(TRead,
TUint8 *aPtr
)[protected, inline]

Sets the start point of the write area within the intermediate buffer.

A start point is always within an area.

MStreamBuf::TWrite

Parameters

TRead
TUint8 * aPtrThe start point.

SetPtr(TWrite, TUint8 *)

voidSetPtr(TWrite,
TUint8 *aPtr
)[protected, inline]

Sets the start point of the write area within the intermediate buffer.

A start point is always within an area.

MStreamBuf::TWrite

Parameters

TWrite
TUint8 * aPtrThe start point.

UnderflowL(TInt)

TInt UnderflowL(TIntaMaxLength)[private, pure virtual]

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.

The amount of data available in the intermediate buffer.

Parameters

TInt aMaxLengthThe maximum amount of data required for the intermediate buffer.

Member Type Definitions Documentation

Typedef TArea

typedef TInt TArea[protected]

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

MStreamBuf::TWrite

Member Data Documentation

TUint8 * iREnd

TUint8 *iREnd[private]

TUint8 * iRPtr

TUint8 *iRPtr[private]

TUint8 * iWEnd

TUint8 *iWEnd[private]

TUint8 * iWPtr

TUint8 *iWPtr[private]