Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <S32MEM.H>
Link against: estor.lib

Class TMemBuf

class TMemBuf : public TStreamBuf;

Description

A stream buffer that uses plain memory for its implementation.

A stream of this type is used by RMemWriteStream and RMemReadStream objects. It also has intermediate buffering capabilities.

This is a seekable stream buffer.

Derivation

Members

Defined in TMemBuf:

Inherited from MStreamBuf:

Inherited from TStreamBuf:


Construction and destruction


TMemBuf()

IMPORT_C TMemBuf();

Description

Constructs an empty object.

Call TMemBuf::Set(TUint8 *,TUint8 *,TInt) before using the object.

[Top]


Member functions


Set(TUint8 *,TUint8 *,TInt)

IMPORT_C void Set(TUint8 *aPtr, TUint8 *anEnd, TInt aMode=ERead|EWrite);

Description

Sets up the stream to use the specified area of plain memory.

Parameters

TUint8 *aPtr

The start address for the area of plain memory that hosts the stream and that also acts as the intermediate buffer.

TUint8 *anEnd

The end address for the area of plain memory that hosts the stream and that also acts as the intermediate buffer. The addressed byte is outside the memory area.

TInt aMode

The mode in which the stream is to be used. It can be used in either or both read and write modes, represented by ERead and EWrite.

See also:


UnderflowL(TInt)

protected: IMPORT_C virtual TInt UnderflowL(TInt aMaxLength);

Description

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.

Parameters

TInt aMaxLength

The maximum amount of data required for the intermediate buffer.

Return value

TInt

The amount of data available in the intermediate buffer.


OverflowL()

protected: IMPORT_C virtual void OverflowL();

Description

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.


DoSeekL(TMark,TStreamLocation,TInt)

protected: IMPORT_C virtual TStreamPos DoSeekL(TMark aMark, TStreamLocation aLocation, TInt anOffset);

Description

Parameters

MStreamBuf::TMark aMark

TStreamLocation aLocation

TInt anOffset

Return value

TStreamPos