class TStreamFilter : public MStreamBuf |
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.
Protected Member Functions | |
---|---|
TStreamFilter() | |
void | Committed() |
IMPORT_C TInt | DoReadL(TAny *, TInt) |
IMPORT_C void | DoRelease() |
IMPORT_C void | DoSynchL() |
IMPORT_C void | DoWriteL(const TAny *, TInt) |
IMPORT_C void | EmitL(const TAny *, TInt) |
TBool | IsCommitted() |
void | Set(MStreamBuf *, TInt) |
Private Member Functions | |
---|---|
TInt | Capacity(TInt) |
TInt | FilterL(TAny *, TInt, const TUint8 *&, const TUint8 *) |
IMPORT_C void | __DbgChkMode(TInt) |
Inherited Enumerations | |
---|---|
MStreamBuf:TRead | |
MStreamBuf:TWrite |
Private Attributes | |
---|---|
MStreamBuf * | iHost |
TInt | iMode |
TInt | Capacity | ( | TInt | aMaxLength | ) | [private, pure virtual] |
Calculates the maximum size of unfiltered data necessary to give the specified amount of filtered data.
TInt aMaxLength | The amount of filtered data required. |
IMPORT_C TInt | DoReadL | ( | TAny * | aPtr, |
TInt | aMaxLength | |||
) | [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.
TAny * aPtr | A pointer to the target memory location for the filtered data. |
TInt 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. |
IMPORT_C void | DoSynchL | ( | ) | [protected, virtual] |
Synchronizes the host's intermediate buffer with its stream, leaving if any error occurs.
IMPORT_C void | DoWriteL | ( | const TAny * | aPtr, |
TInt | aLength | |||
) | [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.
IMPORT_C void | EmitL | ( | const TAny * | aPtr, |
TInt | aLength | |||
) | [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.
TInt | FilterL | ( | TAny * | aPtr, |
TInt | aMaxLength, | |||
const TUint8 *& | aFrom, | |||
const TUint8 * | anEnd | |||
) | [private, pure virtual] |
Performs the filtration process.
TAny * aPtr | Pointer to the output location for the filtered data. |
TInt aMaxLength | The maximum amount of space available for the filtered data. |
const TUint8 *& aFrom | A reference to a pointer to the unfiltered data source. This pointer should be advanced as the source is consumed. |
const TUint8 * anEnd | Pointer to the first byte beyond the end of the unfiltered data source. |
TBool | IsCommitted | ( | ) | const [protected, inline] |
Tests whether the streamed data is committed.
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.
MStreamBuf * aHost | The host for the streamed data - a stream buffer. |
TInt 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. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.