Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: s32buf.h
Link against: estor.lib

Class TStreamTransfer

TStreamTransfer

Support

Supported from 5.0

Description

Stream transfer object.

Holds and maintains a value that represents how much data is to be transferred, or remains to be transferred, between streams.

Objects of this type are used by ReadL() and WriteL() functions of MStreamBuf.

Defined in TStreamTransfer:
EUnlimited, Left(), TStreamTransfer(), TUnlimited, operator-(), operator-=(), operator==(), operator>(), operator[]

See also:


Construction


TStreamTransfer()

TStreamTransfer();

Description

Constructs an empty stream transfer object.


TStreamTransfer()

TStreamTransfer(TInt aMaxLength);

Description

Constructs a stream transfer object specifying a length value.

This value represents the maximum amount of data that can be transferred between streams.

Parameters

TInt aMaxLength

The maximum length of data that can be transferred. In debug mode, the function raises a STORE-Stream 13 panic, if this value is negative.


TStreamTransfer()

TStreamTransfer(TUnlimited);

Description

Constructs a stream transfer object specifying that there is no explicit limit to the amount of data that can be transferred between streams.

The amount of data to be transferred is only limited by the streams themselves.

The arithmetical operators do not change the state of an unlimited stream transfer object.

Parameters

TUnlimited

(The enumerator value is not used).

[Top]


Comparison operators


operator==()

TBool operator==(TInt aLength) const;

Description

Tests whether the stream transfer value is equal to the specified value.

Parameters

TInt aLength

The length to compared. In debug mode, the function raises a STORE-Stream 13 panic, if this value is negative.

Return value

TBool

True, if the stream transfer value is equal to the specified value; false, otherwise.


operator>()

TBool operator>(TInt aLength) const;

Description

Tests whether the stream transfer value is greater than the specified value.

Parameters

TInt aLength

The length to compared. In debug mode, the function raises a STORE-Stream 13 panic, if this value is negative.

Return value

TBool

True, if the stream transfer value is greater than the specified value; false, otherwise.


operator[]

TInt operator[](TInt aMaxLength) const;

Description

Clips the stream transfer value to the specified value.

In effect, the operator returns the smaller of the specified value and the stream transfer value.

Parameters

TInt aMaxLength

The length to compared with the stream transfer value.

Return value

TInt

The smaller value.

[Top]


Stream transfer value subtraction operators


operator-()

TStreamTransfer operator-(TInt aLength) const;

Description

Subtracts the specified value from the stream transfer value.

Parameters

TInt aLength

The length to be subtracted. In debug mode, the function raises a STORE-Stream 13 panic, if this value is negative.

Return value

TStreamTransfer

A stream transfer object containing the result of the subtraction.

Notes:


operator-=()

TStreamTransfer& operator-=(TInt aLength);

Description

Subtracts the specified value from the stream transfer value, updating this stream transfer object.

Parameters

TInt aLength

The length to be subtracted. In debug mode, the function raises a STORE-Stream 13 panic, if this value is negative.

Return value

TStreamTransfer&

A reference to this stream transfer object.

Notes:

[Top]


Length remaining


Left()

TInt Left() const;

Description

Gets the stream transfer value.

Return value

TInt

The current stream transfer value.

[Top]


Enumerations


Enum TUnlimited

enum TUnlimited {EUnlimited};

Description

An enumerator type passed to a constructor of this class to indicate that there is no explicit limit to the amount of data that can be transferred between streams.

EUnlimited

The enumeration is not used.