TStreamFilter Class Reference

#include <s32buf.h>

class TStreamFilter : public MStreamBuf

Inherits from

Public Member Enumerations
enumanonymous { EAttached }
Protected Member Functions
TStreamFilter()
voidCommitted()
virtual IMPORT_C TIntDoReadL(TAny *, TInt)
virtual IMPORT_C voidDoRelease()
virtual IMPORT_C voidDoSynchL()
virtual IMPORT_C voidDoWriteL(const TAny *, TInt)
IMPORT_C voidEmitL(const TAny *, TInt)
TBool IsCommitted()
voidSet(MStreamBuf *, TInt)
Inherited Enumerations
MStreamBuf:TRead
MStreamBuf:TWrite
Inherited Functions
MStreamBuf::Close()
MStreamBuf::MStreamBuf()
MStreamBuf::PushL()
MStreamBuf::Read(TDes8 &,TInt,TRequestStatus &)
MStreamBuf::Read(TDes8 &,TRequestStatus &)
MStreamBuf::ReadL(MStreamInput &)
MStreamBuf::ReadL(MStreamInput &,TInt)
MStreamBuf::ReadL(MStreamInput &,TStreamTransfer)
MStreamBuf::ReadL(TAny *,TInt)
MStreamBuf::ReadL(TDes8 &,TInt,TRequestStatus &)
MStreamBuf::ReadL(TDes8 &,TRequestStatus &)
MStreamBuf::Release()
MStreamBuf::SeekL(TMark,TStreamLocation,TInt)
MStreamBuf::SeekL(TMark,TStreamPos)
MStreamBuf::SeekL(TRead,TInt)
MStreamBuf::SeekL(TRead,TStreamLocation,TInt)
MStreamBuf::SeekL(TWrite,TInt)
MStreamBuf::SeekL(TWrite,TStreamLocation,TInt)
MStreamBuf::SizeL()const
MStreamBuf::Synch()
MStreamBuf::SynchL()
MStreamBuf::TellL(TRead)const
MStreamBuf::TellL(TWrite)const
MStreamBuf::Write(const TDesC8 &,TInt,TRequestStatus &)
MStreamBuf::Write(const TDesC8 &,TRequestStatus &)
MStreamBuf::WriteL(MStreamOutput &)
MStreamBuf::WriteL(MStreamOutput &,TInt)
MStreamBuf::WriteL(MStreamOutput &,TStreamTransfer)
MStreamBuf::WriteL(const TAny *,TInt)
MStreamBuf::WriteL(const TDesC8 &,TInt,TRequestStatus &)
MStreamBuf::WriteL(const TDesC8 &,TRequestStatus &)
Inherited Type Definitions
MStreamBuf::TMark

Detailed Description

Interface to a stream filter.

A stream filter is an object that allows stream data to be filtered after retrieval from a host or filtered before being written to a host.

The class is abstract and a derived class must be defined an implemented.

Member Enumeration Documentation

Enum anonymous

EnumeratorValueDescription
EAttached0x10

Constructor & Destructor Documentation

TStreamFilter ( )

IMPORT_CTStreamFilter()[protected]

Constructs an empty stream filter object.

Member Function Documentation

Committed ( )

voidCommitted()[protected, inline]

Flags the streamed data as committed.

DoReadL ( TAny *, TInt )

IMPORT_C TIntDoReadL(TAny *aPtr,
TIntaMaxLength
)[protected, virtual]

Reads data from the host stream through the filter into the specified memory location.

In debug mode: the filter must be in read mode, otherwise the function raises a STORE-Stream 10 panic.

In debug mode, a host stream must have been set before calling this function, otherwise it raises a STORE-Stream 0 panic.

Parameters
aPtrA pointer to the target memory location for the filtered data.
aMaxLengthThe maximum number of bytes to be read. In debug mode: if this value is negative then the function raises a STORE-Stream 1 panic; if this value is zero, then the function raises a STORE-Stream 3 panic.
Return Value
The number of bytes read.

DoRelease ( )

IMPORT_C voidDoRelease()[protected, virtual]

Reimplemented from MStreamBuf::DoRelease()

Frees the host stream's resources.

See also: MStreamBuf::DoRelease()

DoSynchL ( )

IMPORT_C voidDoSynchL()[protected, virtual]

Reimplemented from MStreamBuf::DoSynchL()

Synchronizes the host's intermediate buffer with its stream, leaving if any error occurs.

See also: MStreamBuf::DoSynchL()

DoWriteL ( const TAny *, TInt )

IMPORT_C voidDoWriteL(const TAny *aPtr,
TIntaLength
)[protected, virtual]

Writes data to the host stream through the filter from the specified memory location.

In debug mode: the filter must be in write mode, otherwise the function raises a STORE-Stream 11 panic.

In debug mode, a host stream must have been set before calling this function, otherwise it raises a STORE-Stream 0 panic.

Parameters
aPtrA pointer to the source memory location.
aLengthThe number of bytes to be written. In debug mode: if this value is negative then the function raises a STORE-Stream 1 panic; if this value is zero, then the function raises a STORE-Stream 7 panic.

EmitL ( const TAny *, TInt )

IMPORT_C voidEmitL(const TAny *aPtr,
TIntaLength
)[protected]

Writes data from the specified memory location directly to the host without filtering.

This is useful for sending any final data, when flushing the filter as part of DoSynchL().

In debug mode: the filter must be in write mode, otherwise the function raises a STORE-Stream 11 panic.

In debug mode, a host stream must have been set before calling this function, otherwise it raises a STORE-Stream 0 panic.

See also: DoSynchL()

Parameters
aPtrA pointer to the memory location from which data is to be written to the host stream.
aLengthThe number of bytes to be written.

IsCommitted ( )

TBool IsCommitted()const [protected, inline]

Tests whether the streamed data is committed.

Return Value
True, if streamed data is committed; false, otherwise.

Set ( MStreamBuf *, TInt )

voidSet(MStreamBuf *aHost,
TIntaMode
)[protected, inline]

Sets up the filter to use the specified host for streamed data.

Taking ownership of the host stream buffer means that calls to SynchL() propagate to the host buffer after the filter has flushed its data, and that when the filter is released it also releases the host buffer.

See also: MStreamBuf::TRead MStreamBuf::TWrite

Parameters
aHostThe host for the streamed data - a stream buffer.
aModeThe mode in which the stream buffer is to be used. It can be used in either read or write modes, represented by ERead and EWrite, but not both at the same time. In debug mode, setting both raises a STORE-Stream 18 panic. In addition, specify EAttached to indicate that the filter should take ownership of the host stream buffer.