|
||
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.
MStreamBuf
-
A stream buffer that provides a generic I/O interface for streamed data.
RShareBuf
-
A shared stream buffer.
Defined in RShareBuf
:
DoReadL(MStreamInput &,TStreamTransfer)
Reads data from the stream into the specified data sink.DoReadL(TAny *,TInt)
DoReadL(TDes8 &,TInt,TRequestStatus &)
Reads data from the stream buffer into the specified descriptor.DoRelease()
Frees resources before abandoning the stream buffer.DoSeekL(TMark,TStreamLocation,TInt)
DoWriteL(MStreamOutput &,TStreamTransfer)
DoWriteL(const TAny *,TInt)
DoWriteL(const TDesC8 &,TInt,TRequestStatus &)
Writes data from the specified descriptor into this stream buffer.Open(TStreamExchange &,TInt)
Prepares the shared stream buffer for streaming.Open(TStreamExchange &,TStreamPos,TInt)
Prepares the shared stream buffer for streaming.RShareBuf()
Constructs an empty shared stream buffer object.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...RFileBuf
A stream buffer hosted by a file. ...RShareReadStream
...RShareWriteStream
...IMPORT_C RShareBuf();
Constructs an empty shared stream buffer object.
Call one of the RShareBuf::Open(TStreamExchange &,TStreamPos,TInt)
functions to prepare the stream.
IMPORT_C void Open(TStreamExchange &aHost, TStreamPos aPos, TInt aMode=ERead|EWrite);
Prepares the shared stream buffer for streaming.
The function sets the read mark and/or the write mark to the specified position within the host stream.
|
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...inline void Open(TStreamExchange &aHost, TInt aMode=ERead|EWrite);
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
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 void DoRelease();
Frees resources before abandoning the stream buffer.
It is called by MStreamBuf::Release()
.
This implementation is empty, but classes derived from MStreamBuf
can provide their own implementation, if necessary.
MStreamBuf::Release()
Frees resources before abandoning the stream buffer.protected: IMPORT_C virtual TInt DoReadL(TAny *aPtr, TInt aMaxLength);
|
|
protected: IMPORT_C virtual TInt DoReadL(TDes8 &aDes, TInt aMaxLength, TRequestStatus &aStatus);
Reads data from the stream buffer into the specified descriptor.
This function is called by MStreamBuf::ReadL(TDes8 &,TInt,TRequestStatus &)
.
This implementation deals with the request synchronously, and completes the request with KErrNone. Other implementations may choose to deal with this in a true asynchronous manner.
In addition, the read operation itself uses the RShareBuf::DoReadL(TAny *,TInt)
variant.
|
|
MStreamBuf::ReadL(TAny *,TInt)
Reads data from the stream buffer into the specified memory location.protected: IMPORT_C virtual TStreamTransfer DoReadL(MStreamInput &anInput, TStreamTransfer aTransfer);
Reads data from the stream into the specified data sink.
It is called by MStreamBuf::ReadL(MStreamInput &,TStreamTransfer)
.
This implementation calls the sink's ReadFromL() function, which performs the read (transfer) operation.
This implementation of RShareBuf::DoReadL(TAny *,TInt)
is called for streams that do not have buffering capabilities, and that are derived directly from this class.
|
|
MStreamInput::ReadFromL(MStreamBuf &,TStreamTransfer)
Reads data from the specified stream into this stream input object.protected: IMPORT_C virtual void DoWriteL(const TAny *aPtr, TInt aLength);
|
protected: IMPORT_C virtual TInt DoWriteL(const TDesC8 &aDes, TInt aMaxLength, TRequestStatus &aStatus);
Writes data from the specified descriptor into this stream buffer.
This function is called by MStreamBuf::WriteL(const TDesC8 &,TInt,TRequestStatus &)
.
This implementation deals with the request synchronously, and completes the request with KErrNone. Other implementations may choose to deal with this in a true asynchronous manner.
In addition, the write operation itself uses the DoWriteL(TAny*,TInt) variant.
|
|
MStreamBuf::WriteL(const TAny *,TInt)
Writes data from the specified memory location into the stream buffer.protected: IMPORT_C virtual TStreamTransfer DoWriteL(MStreamOutput &anOutput, TStreamTransfer aTransfer);
|
|
protected: IMPORT_C virtual TStreamPos DoSeekL(TMark aMark, TStreamLocation aLocation, TInt anOffset);
|
|