TStreamMark Class Reference

class TStreamMark

Manages the position of a read mark or a write mark within a shared stream.

A shared stream is one that shares its host with other streams. In practice, the host is a stream buffer that is, itself, hosted by a file, an RFileBuf object.

TStreamMark objects are owned by RShareBuf, one for reading and one for writing. They re-direct read/write operations through a TStreamExchange object to the RFileBuf object, which handles the actual file read and write operations.

RFileBuf RShareBuf TStreamExchange

Public Member Functions
TStreamMark()
TStreamMark(TStreamPos)
voidClear()
voidExtractL(TStreamExchange &)
TBool IsEmpty()
TBool IsWith(TStreamExchange &)
TStreamPos Position()
TInt ReadL(TStreamExchange &, TAny *, TInt)
IMPORT_C TIntReadL(TStreamExchange &, TDes8 &, TRequestStatus &)
TInt ReadL(TStreamExchange &, TDes8 &, TInt, TRequestStatus &)
TStreamTransfer ReadL(TStreamExchange &, MStreamInput &, TStreamTransfer)
TInt ReadL(TStreamExchange &, MStreamInput &, TInt)
voidReadL(TStreamExchange &, MStreamInput &)
TBool RelatesTo(TStreamExchange &)
voidSeekL(TStreamExchange &, TStreamPos)
TStreamPos SeekL(TStreamExchange &, TStreamLocation, TInt)
TStreamPos SeekL(TStreamExchange &, TInt)
TStreamPos TellL(TStreamExchange &)
voidWithdraw(TStreamExchange &)
voidWriteL(TStreamExchange &, const TAny *, TInt)
IMPORT_C TIntWriteL(TStreamExchange &, const TDesC8 &, TRequestStatus &)
TInt WriteL(TStreamExchange &, const TDesC8 &, TInt, TRequestStatus &)
TStreamTransfer WriteL(TStreamExchange &, MStreamOutput &, TStreamTransfer)
TInt WriteL(TStreamExchange &, MStreamOutput &, TInt)
voidWriteL(TStreamExchange &, MStreamOutput &)
operator TStreamMark *()
operator const TStreamMark *()
TBool operator!=(const TStreamMark &)
TBool operator!=(const TStreamMark *)
TStreamMark &operator=(TStreamPos)
TBool operator==(const TStreamMark &)
TBool operator==(const TStreamMark *)
Private Member Functions
TStreamMark(const TStreamMark &)
TBool IsTracking(TStreamMark *const &)
voidTrack(TStreamMark *const &)
IMPORT_C void__DbgChkPos(TStreamPos)
TStreamMark &operator=(const TStreamMark &)
Private Attributes
TStreamPos iPos

Constructor & Destructor Documentation

TStreamMark()

TStreamMark()[inline]

Constructs a default shared stream mark object.

The position for the mark is uninitialised.

An uninitialised mark means that a call to IsEmpty() returns true.

IsEmpty()

TStreamMark(TStreamPos)

TStreamMark(TStreamPosaPos)[inline]

Constructs the shared stream mark object, setting the mark to the specified stream position.

An initialised mark means that a call to IsEmpty() returns false.

IsEmpty()

Parameters

TStreamPos aPosThe stream position

TStreamMark(const TStreamMark &)

TStreamMark(const TStreamMark &)[private]

Constructs a default shared stream mark object.

The position for the mark is uninitialised.

An uninitialised mark means that a call to IsEmpty() returns true.

IsEmpty()

Parameters

const TStreamMark &

Member Functions Documentation

Clear()

voidClear()[inline]

Resets the mark object to its default state.

On return from this function, the mark is uninitialised and a call to IsEmpty() returns true.

Empties the object/makes it empty so that IsEmpty() returns false

ExtractL(TStreamExchange &)

voidExtractL(TStreamExchange &aHost)[inline]

Refreshes this mark from the mark in the host stream buffer and tells the shared streaming manager to drop any reference it has to to this mark object.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.

IsEmpty()

TBool IsEmpty()const [inline]

Tests whether this mark object is uninitialised.

IsTracking(TStreamMark *const &)

TBool IsTracking(TStreamMark *const &aRef)const [private, inline]

Parameters

TStreamMark *const & aRef

IsWith(TStreamExchange &)

TBool IsWith(TStreamExchange &aHost)const [inline]

Tests whether the specified shared streaming manager currently refers to this mark object.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.

Position()

TStreamPos Position()const [inline]

Gets the position of the mark.

ReadL(TStreamExchange &, TAny *, TInt)

TInt ReadL(TStreamExchange &aHost,
TAny *aPtr,
TIntaMaxLength
)[inline]

Reads data from the shared stream into the specified memory location.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
TAny * aPtrA pointer to the target memory location for the data read from the shared stream.
TInt aMaxLengthThe maximum number of bytes to be read.

ReadL(TStreamExchange &, TDes8 &, TRequestStatus &)

IMPORT_C TIntReadL(TStreamExchange &aHost,
TDes8 &aDes,
TRequestStatus &aStatus
)

Parameters

TStreamExchange & aHost
TDes8 & aDes
TRequestStatus & aStatus

ReadL(TStreamExchange &, TDes8 &, TInt, TRequestStatus &)

TInt ReadL(TStreamExchange &aHost,
TDes8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus
)[inline]

Reads data, asynchronously, from the shared stream into the specified descriptor.

If the function leaves, then no read request will have been initiated.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
TDes8 & aDesThe target descriptor for the data read from the shared stream.
TInt aMaxLengthThe maximum number of bytes to be read.
TRequestStatus & aStatusThe request status that indicates the completion status of this asynchronous request.

ReadL(TStreamExchange &, MStreamInput &, TStreamTransfer)

TStreamTransfer ReadL(TStreamExchange &aHost,
MStreamInput &anInput,
TStreamTransferaTransfer
)[inline]

Reads data from the shared stream into the specified data sink.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
MStreamInput & anInputThe sink which is the target for the read operation.
TStreamTransfer aTransferDefines the amount of data available to be read from the shared stream.

ReadL(TStreamExchange &, MStreamInput &, TInt)

TInt ReadL(TStreamExchange &aHost,
MStreamInput &anInput,
TIntaMaxLength
)[inline]

Reads data from the shared stream into the specified data sink.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
MStreamInput & anInputThe sink which is the target for the read operation.
TInt aMaxLengthThe maximum amount of data available to be read from the shared stream.

ReadL(TStreamExchange &, MStreamInput &)

voidReadL(TStreamExchange &aHost,
MStreamInput &anInput
)[inline]

Reads data from the shared stream into the specified data sink.

No explicit limit is placed on the amount of data that can be read.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
MStreamInput & anInputThe sink which is the target for the read operation.

RelatesTo(TStreamExchange &)

TBool RelatesTo(TStreamExchange &aHost)const [inline]

Tests whether the specified shared streaming manager currently refers to this mark object OR whether this mark object is initialised.

IsWith() TStreamExchange::IsActive()

Parameters

TStreamExchange & aHostThe object that manages shared streaming.

SeekL(TStreamExchange &, TStreamPos)

voidSeekL(TStreamExchange &aHost,
TStreamPosaPos
)[inline]

Parameters

TStreamExchange & aHost
TStreamPos aPos

SeekL(TStreamExchange &, TStreamLocation, TInt)

TStreamPos SeekL(TStreamExchange &aHost,
TStreamLocationaLocation,
TIntanOffset = 0
)[inline]

Moves the position of the mark in the host stream.

The new position is calculated by adding the specified offset to one of:

the position of the beginning of the host stream

the position of the end of the host stream

the position of the current mark.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
TStreamLocation aLocationThe location in the host stream on which the calculation of the new position is based.
TInt anOffset = 0The offset value.

SeekL(TStreamExchange &, TInt)

TStreamPos SeekL(TStreamExchange &aHost,
TIntanOffset
)[inline]

Moves the position of the mark in the host stream.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
TInt anOffsetThe amount by which the position of the mark is to be moved relative to the existing position of the mark.

TellL(TStreamExchange &)

TStreamPos TellL(TStreamExchange &aHost)const [inline]

Gets the position of the mark within the host stream.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.

Track(TStreamMark *const &)

voidTrack(TStreamMark *const &aRef)[private, inline]

Parameters

TStreamMark *const & aRef

Withdraw(TStreamExchange &)

voidWithdraw(TStreamExchange &aHost)[inline]

Instructs the shared streaming manager to remove any reference it has to this mark object.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.

WriteL(TStreamExchange &, const TAny *, TInt)

voidWriteL(TStreamExchange &aHost,
const TAny *aPtr,
TIntaLength
)[inline]

Writes data from the specified memory location into the shared stream.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
const TAny * aPtrA pointer to the memory location from which data is to be written to the shared stream.
TInt aLengthThe number of bytes to be written.

WriteL(TStreamExchange &, const TDesC8 &, TRequestStatus &)

IMPORT_C TIntWriteL(TStreamExchange &aHost,
const TDesC8 &aDes,
TRequestStatus &aStatus
)

Writes data, asynchronously, from the specified descriptor into the shared stream.

The maximum number of bytes to be written is the value of the maximum length of the descriptor.

If the function leaves, then no write request will have been initiated.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
const TDesC8 & aDesThe source descriptor for the data to be written into the shared stream.
TRequestStatus & aStatusThe request status that indicates the completion status of this asynchronous request.

WriteL(TStreamExchange &, const TDesC8 &, TInt, TRequestStatus &)

TInt WriteL(TStreamExchange &aHost,
const TDesC8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus
)[inline]

Writes data, asynchronously, from the specified descriptor into the shared stream.

If the function leaves, then no write request will have been initiated.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
const TDesC8 & aDesThe source descriptor for the data to be written into the shared stream.
TInt aMaxLengthThe maximum number of bytes to be written.
TRequestStatus & aStatusThe request status that indicates the completion status of this asynchronous request.

WriteL(TStreamExchange &, MStreamOutput &, TStreamTransfer)

TStreamTransfer WriteL(TStreamExchange &aHost,
MStreamOutput &anOutput,
TStreamTransferaTransfer
)[inline]

Writes data into the shared stream from the specified data source.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
MStreamOutput & anOutputThe data source for the write operation.
TStreamTransfer aTransferDefines the amount of data to be pulled from the output stream object.

WriteL(TStreamExchange &, MStreamOutput &, TInt)

TInt WriteL(TStreamExchange &aHost,
MStreamOutput &anOutput,
TIntaMaxLength
)[inline]

Writes data into the shared stream from the specified data source

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
MStreamOutput & anOutputThe data source for the write operation.
TInt aMaxLengthThe maximum amount of data available to be written.

WriteL(TStreamExchange &, MStreamOutput &)

voidWriteL(TStreamExchange &aHost,
MStreamOutput &anOutput
)[inline]

Writes data into the shared stream from the specified data source.

No explicit limit is placed on the amount of data that can be written.

Parameters

TStreamExchange & aHostThe object that manages shared streaming.
MStreamOutput & anOutputThe data source for the write operation.

__DbgChkPos(TStreamPos)

IMPORT_C void__DbgChkPos(TStreamPosaPos)[private, static]

Parameters

TStreamPos aPos

operator TStreamMark *()

operator TStreamMark *()[inline]

operator const TStreamMark *()

operator const TStreamMark *()const [inline]

operator!=(const TStreamMark &)

TBool operator!=(const TStreamMark &aMark)const [inline]

Tests whether this object and the specified shared stream mark object are different objects.

Parameters

const TStreamMark & aMarkA pointer to a shared stream mark object.

operator!=(const TStreamMark *)

TBool operator!=(const TStreamMark *aPtr)const [inline]

Parameters

const TStreamMark * aPtr

operator=(TStreamPos)

TStreamMark &operator=(TStreamPosaPos)[inline]

Assigns the specified stream position value to this shared stream mark object.

Parameters

TStreamPos aPosThe stream position value to be assigned.

operator=(const TStreamMark &)

TStreamMark &operator=(const TStreamMark &)[private]

Parameters

const TStreamMark &

operator==(const TStreamMark &)

TBool operator==(const TStreamMark &aMark)const [inline]

Tests whether this object and the specified referenced shared stream mark object are the same object.

Parameters

const TStreamMark & aMarkA reference to a shared stream mark object.

operator==(const TStreamMark *)

TBool operator==(const TStreamMark *aPtr)const [inline]

Parameters

const TStreamMark * aPtr

Member Data Documentation

TStreamPos iPos

TStreamPos iPos[private]