TBufBuf Class Reference

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.

RBufWriteStream

RBufReadStream

CBufBase::Size()

MStreamBuf::SynchL()

Inherits from

Public Member Functions
TBufBuf()
IMPORT_C voidSet(CBufBase &, TInt, TInt)
Protected Member Functions
IMPORT_C TStreamPosDoSeekL(TMark, TStreamLocation, TInt)
IMPORT_C voidDoSynchL()
IMPORT_C voidDoWriteL(const TAny *, TInt)
IMPORT_C voidOverflowL()
IMPORT_C TIntUnderflowL(TInt)
Private Member Functions
CBufBase &Buf()
voidConsolidate()
TInt Mark(TRead)
TInt Mark(TWrite)
TInt MovePos(TRead, TInt)
TInt MovePos(TWrite, TInt)
TInt Pos(TMark)
TInt Pos(TRead)
TInt Pos(TWrite)
voidSetPos(TMark, TInt)
voidSetPos(TRead, TInt)
voidSetPos(TWrite, 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 &)
TStreamBuf::Avail(TArea)const
TStreamBuf::Avail(TRead)const
TStreamBuf::Avail(TWrite)const
TStreamBuf::DoReadL(MStreamInput &,TStreamTransfer)
TStreamBuf::DoReadL(TAny *,TInt)
TStreamBuf::DoWriteL(MStreamOutput &,TStreamTransfer)
TStreamBuf::End(TArea)const
TStreamBuf::End(TRead)const
TStreamBuf::End(TWrite)const
TStreamBuf::Ptr(TArea)const
TStreamBuf::Ptr(TRead)const
TStreamBuf::Ptr(TWrite)const
TStreamBuf::SetBuf(TArea,TUint8 *,TUint8 *)
TStreamBuf::SetBuf(TRead,TUint8 *,TUint8 *)
TStreamBuf::SetBuf(TWrite,TUint8 *,TUint8 *)
TStreamBuf::SetEnd(TArea,TUint8 *)
TStreamBuf::SetEnd(TRead,TUint8 *)
TStreamBuf::SetEnd(TWrite,TUint8 *)
TStreamBuf::SetPtr(TArea,TUint8 *)
TStreamBuf::SetPtr(TRead,TUint8 *)
TStreamBuf::SetPtr(TWrite,TUint8 *)
TStreamBuf::TStreamBuf()
Inherited Enumerations
MStreamBuf:TRead
MStreamBuf:TWrite
Private Attributes
CBufBase *iBuf
TInt iMode
TInt iRPos
TInt iWPos

Constructor & Destructor Documentation

TBufBuf()

IMPORT_CTBufBuf()

Member Functions Documentation

Buf()

CBufBase &Buf()const [private, inline]

Consolidate()

voidConsolidate()[private]

DoSeekL(TMark, TStreamLocation, TInt)

IMPORT_C TStreamPosDoSeekL(TMarkaMark,
TStreamLocationaLocation,
TIntanOffset
)[protected, virtual]

Parameters

TMark aMark
TStreamLocation aLocation
TInt anOffset

DoSynchL()

IMPORT_C voidDoSynchL()[protected, virtual]

DoWriteL(const TAny *, TInt)

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

Parameters

const TAny * aPtr
TInt aLength

Mark(TRead)

TInt Mark(TRead)const [private, inline]

Parameters

TRead

Mark(TWrite)

TInt Mark(TWrite)const [private, inline]

Parameters

TWrite

MovePos(TRead, TInt)

TInt MovePos(TRead,
TIntanOffset
)[private, inline]

Parameters

TRead
TInt anOffset

MovePos(TWrite, TInt)

TInt MovePos(TWrite,
TIntanOffset
)[private, inline]

Parameters

TWrite
TInt anOffset

OverflowL()

IMPORT_C voidOverflowL()[protected, 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.

Pos(TMark)

TInt Pos(TMarkaMark)const [private]

Parameters

TMark aMark

Pos(TRead)

TInt Pos(TRead)const [private, inline]

Parameters

TRead

Pos(TWrite)

TInt Pos(TWrite)const [private, inline]

Parameters

TWrite

Set(CBufBase &, TInt, TInt)

IMPORT_C voidSet(CBufBase &aBuf,
TIntaPos,
TIntaMode = ERead|EWrite
)

Parameters

CBufBase & aBuf
TInt aPos
TInt aMode = ERead|EWrite

SetPos(TMark, TInt)

voidSetPos(TMarkaMark,
TIntaPos
)[private]

Parameters

TMark aMark
TInt aPos

SetPos(TRead, TInt)

voidSetPos(TRead,
TIntaPos
)[private, inline]

Parameters

TRead
TInt aPos

SetPos(TWrite, TInt)

voidSetPos(TWrite,
TIntaPos
)[private, inline]

Parameters

TWrite
TInt aPos

UnderflowL(TInt)

IMPORT_C TIntUnderflowL(TIntaMaxLength)[protected, 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 Data Documentation

CBufBase * iBuf

CBufBase *iBuf[private]

TInt iMode

TInt iMode[private]

TInt iRPos

TInt iRPos[private]

TInt iWPos

TInt iWPos[private]