#include <s32buf.h>
class TStreamFilter : public MStreamBuf |
Public Member Enumerations | |
---|---|
enum | anonymous { EAttached } |
Protected Member Functions | |
---|---|
TStreamFilter() | |
void | Committed() |
virtual IMPORT_C TInt | DoReadL(TAny *, TInt) |
virtual IMPORT_C void | DoRelease() |
virtual IMPORT_C void | DoSynchL() |
virtual IMPORT_C void | DoWriteL(const TAny *, TInt) |
IMPORT_C void | EmitL(const TAny *, TInt) |
TBool | IsCommitted() |
void | Set(MStreamBuf *, TInt) |
Inherited Enumerations | |
---|---|
MStreamBuf:TRead | |
MStreamBuf:TWrite |
Inherited Type Definitions | |
---|---|
MStreamBuf::TMark |
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.
Reimplemented from MStreamBuf::DoReadL(TAny *,TInt)
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.
Parameter | Description |
---|---|
aPtr | A pointer to the target memory location for the filtered data. |
aMaxLength | The 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. |
Returns: The number of bytes read.
IMPORT_C void | DoRelease | ( | ) | [protected, virtual] |
Reimplemented from MStreamBuf::DoRelease()
Frees the host stream's resources.
See also: MStreamBuf::DoRelease()
IMPORT_C void | DoSynchL | ( | ) | [protected, virtual] |
Reimplemented from MStreamBuf::DoSynchL()
Synchronizes the host's intermediate buffer with its stream, leaving if any error occurs.
See also: MStreamBuf::DoSynchL()
Reimplemented from MStreamBuf::DoWriteL(const TAny *,TInt)
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.
Parameter | Description |
---|---|
aPtr | A pointer to the source memory location. |
aLength | The 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. |
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()
Parameter | Description |
---|---|
aPtr | A pointer to the memory location from which data is to be written to the host stream. |
aLength | The number of bytes to be written. |
TBool | IsCommitted | ( | ) | const [protected, inline] |
Tests whether the streamed data is committed.
Returns: True, if streamed data is committed; false, otherwise.
void | Set | ( | MStreamBuf * | aHost, |
TInt | aMode | |||
) | [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
Parameter | Description |
---|---|
aHost | The host for the streamed data - a stream buffer. |
aMode | The 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. |