RShareBuf Class Reference

class RShareBuf : public MStreamBuf

A shared stream buffer.

This class is part of the framework used by CFileStore that allows multiple stream buffers to concurrently access the single hosting file buffer, an RFileBuf object.

Each shared stream buffer maintains its own read and write positions.

Read and write operations to RShareBuf are directed through separate TStreamMark objects, one for read and one for write. The TStreamMark objects re-direct read/write operations through a TStreamExchange object to the RFileBuf object, which handles the actual file read and write operations.

This stream buffer can also be accessed through RShareReadStream and RShareWriteStream objects.

TStreamMark

TStreamExchange

RFileBuf

RShareReadStream

RShareWriteStream

Inherits from

Public Member Functions
RShareBuf()
IMPORT_C voidOpen(TStreamExchange &, TStreamPos, TInt)
voidOpen(TStreamExchange &, TInt)
Protected Member Functions
IMPORT_C TIntDoReadL(TAny *, TInt)
IMPORT_C TIntDoReadL(TDes8 &, TInt, TRequestStatus &)
IMPORT_C TStreamTransferDoReadL(MStreamInput &, TStreamTransfer)
IMPORT_C voidDoRelease()
IMPORT_C TStreamPosDoSeekL(TMark, TStreamLocation, TInt)
IMPORT_C voidDoWriteL(const TAny *, TInt)
IMPORT_C TIntDoWriteL(const TDesC8 &, TInt, TRequestStatus &)
IMPORT_C TStreamTransferDoWriteL(MStreamOutput &, TStreamTransfer)
Private Member Functions
TStreamExchange &Host()
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
Private Attributes
TStreamExchange *iHost
TStreamMark iRMark
TStreamMark iWMark

Constructor & Destructor Documentation

RShareBuf()

IMPORT_CRShareBuf()

Member Functions Documentation

DoReadL(TAny *, TInt)

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

Parameters

TAny * aPtr
TInt aMaxLength

DoReadL(TDes8 &, TInt, TRequestStatus &)

IMPORT_C TIntDoReadL(TDes8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus
)[protected, virtual]

Parameters

TDes8 & aDes
TInt aMaxLength
TRequestStatus & aStatus

DoReadL(MStreamInput &, TStreamTransfer)

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

Parameters

MStreamInput & anInput
TStreamTransfer aTransfer

DoRelease()

IMPORT_C voidDoRelease()[protected, virtual]

DoSeekL(TMark, TStreamLocation, TInt)

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

Parameters

TMark aMark
TStreamLocation aLocation
TInt anOffset

DoWriteL(const TAny *, TInt)

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

Parameters

const TAny * aPtr
TInt aLength

DoWriteL(const TDesC8 &, TInt, TRequestStatus &)

IMPORT_C TIntDoWriteL(const TDesC8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus
)[protected, virtual]

Parameters

const TDesC8 & aDes
TInt aMaxLength
TRequestStatus & aStatus

DoWriteL(MStreamOutput &, TStreamTransfer)

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

Parameters

MStreamOutput & anOutput
TStreamTransfer aTransfer

Host()

TStreamExchange &Host()const [private, inline]

Open(TStreamExchange &, TStreamPos, TInt)

IMPORT_C voidOpen(TStreamExchange &aHost,
TStreamPosaPos,
TIntaMode = ERead|EWrite
)

Parameters

TStreamExchange & aHost
TStreamPos aPos
TInt aMode = ERead|EWrite

Open(TStreamExchange &, TInt)

voidOpen(TStreamExchange &aHost,
TIntaMode = ERead|EWrite
)[inline]

Prepares the shared stream buffer for streaming.

The function sets the read mark and/or the write mark to the beginning of the host stream.

MStreamBuf::TRead

MStreamBuf::TWrite

KStreamBeginning

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
TInt aMode = ERead|EWriteThe streaming mode. This can be read and/or write, as indicated by the ERead and EWrite bits.

Member Data Documentation

TStreamExchange * iHost

TStreamExchange *iHost[private]

TStreamMark iRMark

TStreamMark iRMark[private]

TStreamMark iWMark

TStreamMark iWMark[private]