Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: s32mem.h
Link against: estor.lib

Class RBufWriteStream

RBufWriteStream

Support

Supported from 5.0

Description

Supports the writing of a stream hosted by a dynamic buffer.

The stream does not take ownership of the dynamic buffer, which means that the creator is responsible for deleting the buffer when it is no longer needed.

Derivation

RBufWriteStreamSupports the writing of a stream hosted by a dynamic buffer
RWriteStreamThe write stream interface

Defined in RBufWriteStream:
Append(), Insert(), Open(), RBufWriteStream(), Truncate()

Inherited from RWriteStream:
Attach(), Close(), CommitL(), Detach(), Pop(), PushL(), Release(), Sink(), WriteInt16L(), WriteInt32L(), WriteInt8L(), WriteL(), WriteReal32L(), WriteReal64L(), WriteUint16L(), WriteUint32L(), WriteUint8L()

See also:


Construction


RBufWriteStream()

RBufWriteStream();

Description

Constructs an empty write stream object.

Call Open(), Truncate() or Insert() to prepare a stream for writing.


RBufWriteStream()

RBufWriteStream(CBufBase& aBuf,TInt aPos=0);

Description

Constructs the object and prepares a stream, to be hosted by the specified dynamic buffer, for writing using the Open() function.

Parameters

CBufBase& aBuf

The dynamic buffer hosting the stream.

TInt aPos

The offset within the dynamic buffer where the stream is to start. Defaults to zero, if not explicitly specified. The value cannot be greater than the current size of the buffer, otherwise a E32USER-CBase 5 panic will be raised when streaming starts.

See also:

[Top]


Member functions


Open()

void Open(CBufBase& aBuf,TInt aPos=0);

Description

Prepares a stream for writing.

When streaming takes place, any existing data in the dynamic buffer, starting at the specified offset, will be replaced. The dynamic buffer hosting the stream will be extended, if necessary.

A subsequent call to CommitL() will not change the size of the buffer.

Parameters

CBufBase& aBuf

The dynamic buffer hosting the stream.

TInt aPos

The offset within the dynamic buffer where the stream is to start. Defaults to zero, if not explicitly specified. The value cannot be greater than the current size of the buffer, otherwise a E32USER-CBase 5 panic will be raised when streaming starts.

See also:


Truncate()

void Truncate(CBufBase& aBuf,TInt aPos=0);

Description

Prepares a stream for writing.

When streaming takes place, any existing data in the buffer, starting at the specified offset, will be replaced. The dynamic buffer hosting the stream will be extended, if necessary.

A subsequent call to CommitL() truncates the dynamic buffer at the last write point.

Parameters

CBufBase& aBuf

The dynamic buffer hosting the stream.

TInt aPos

The offset within the dynamic buffer where the stream is to start. Defaults to zero, if not explicitly specified. The value cannot be greater than the current size of the buffer, otherwise a E32USER-CBase 5 panic will be raised when streaming starts.


Insert()

void Insert(CBufBase& aBuf,TInt aPos);

Description

Prepares a stream for writing.

When streaming takes place, any existing data in the buffer, starting at the specified offset, will be moved to provide space for the streamed data. Existing data in the dynamic buffer is not lost. The dynamic buffer hosting the stream will be extended, if necessary.

A subsequent call to CommitL() will not change the size of the buffer.

Parameters

CBufBase& aBuf

The dynamic buffer hosting the stream.

TInt aPos

The offset within the dynamic buffer where the stream is to start. Defaults to 0, if not explicitly specified. The value cannot be greater than the current size of the buffer, otherwise a E32USER-CBase 5 panic will be raised when streaming starts.


Append()

void Append(CBufBase& aBuf);

Description

Prepares a stream for writing and appending.

When streaming takes place, the streamed data is appended to any existing data in the dynamic buffer.

A subsequent call to CommitL() will not change the size of the buffer.

Parameters

CBufBase& aBuf

The dynamic buffer hosting the stream.