Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

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

Class TDesBuf

class TDesBuf : public TStreamBuf;

Description

A stream buffer that uses a descriptor for its implementation.

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

This is a seekable stream buffer.

When used in write mode, the length of the descriptor is only updated when the stream buffer's MStreamBuf::SynchL() function is called, i.e. as a result of a call to RWriteStream::CommitL().

Derivation

Members

Defined in TDesBuf:

Inherited from MStreamBuf:

Inherited from TStreamBuf:

See also:


Construction and destruction


TDesBuf()

IMPORT_C TDesBuf();

Description

Constructs an empty object.

Call TDesBuf::Set(TDes8 &,TInt) before using the object.

[Top]


Member functions


Set(TDes8 &,TInt)

IMPORT_C void Set(TDes8 &aDes, TInt aMode=ERead|EWrite);

Description

Sets up the stream to use the specified descriptor.

Parameters

TDes8 &aDes

The descriptor that hosts the stream and that also acts as the intermediate buffer.

TInt aMode

The mode in which the buffer 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.


DoSynchL()

protected: IMPORT_C virtual void DoSynchL();

Description

Synchronises the stream buffer with the stream, leaving if any error occurs.

In effect, this ensures that buffered data is delivered to the stream.

It is called by MStreamBuf::SynchL().

This implementation is empty, but classes derived from MStreamBuf can provide their own implementation, if necessary.

See also:


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