#include <mw/http/framework/cheadercodec.h>
class CHeaderCodec : public CBase |
Protected Attributes | |
---|---|
CHeaderReader * | iReader |
CHeaderWriter * | iWriter |
Public Member Functions | |
---|---|
virtual | ~CHeaderCodec() |
pure virtual TBool | CanDecode(RStringF) |
pure virtual TBool | CanEncode(RStringF) |
IMPORT_C void | DecodeHeaderL(RHeaderField &) |
IMPORT_C void | EncodeHeaderL(RHeaderField &) |
pure virtual CHeaderCodec * | FindDelegateCodecL(RStringF) |
Protected Member Functions | |
---|---|
CHeaderCodec() | |
IMPORT_C void | ConstructL() |
An abstract HTTP header codec.
Each instance of a concrete subclass of CHeaderCodec is associated with, and owned by, a specific CProtocolHandler. It provides on-demand encoding/decoding of HTTP header data, between the generic format used by clients/filters to formulate requests and interpret responses, and the raw format used by the transport handlers (and origin servers/gateways/etc.)
The CHeaderCodec has an associated instance of a sub-class of each of CHeaderReader and CHeaderWriter. It delegates the actual encoding and decoding function to these instances.
Header codecs provide a mechanism for extensibility whereby if one codec can't decode (or encode) a given header, it locates a codec that can, and then delegates the task to that codec instead.
CHeaderReader * | iReader | [protected] |
The owned header reader object that does actual decoding of header fields.
CHeaderWriter * | iWriter | [protected] |
The owned header writer object that does actual encoding of header fields.
IMPORT_C | ~CHeaderCodec | ( | ) | [virtual] |
Intended Usage: Destructor - cleans up and releases resources to the system.
Intended Usage: Concrete header codec classes must implement this method to indicate to the framework whether their concrete CHeaderReader is capable of decoding the named header field.
Parameter | Description |
---|---|
aHeaderField | (in) A proxy for the header field to be encoded |
Returns: A flag indicating ETrue if the field can be decoded.
Intended Usage: Concrete header codec classes must implement this method to indicate to the framework whether their concrete CHeaderWriter is capable of encoding the named header field.
Parameter | Description |
---|---|
aHeaderField | (in) A proxy for the header field to be encoded |
Returns: A flag indicating ETrue if the field can be encoded.
IMPORT_C void | ConstructL | ( | ) | [protected] |
Second phase construction in which any necessary allocation is done Implementations of this interface may leave with standard erros like KErrNoMemory if there is insufficient memory for allocation in the second phase.
IMPORT_C void | DecodeHeaderL | ( | RHeaderField & | aHeader | ) | const |
Decode the supplied header field. This method uses the associated concrete CHeaderReader object to do a conversion of the field into the generic internal representation from the raw form.
Parameter | Description |
---|---|
aHeader | (in) A proxy for the header field to be decoded |
IMPORT_C void | EncodeHeaderL | ( | RHeaderField & | aHeader | ) | const |
Encode the supplied header field. This method uses the associated concrete CHeaderWriter object to do a conversion of the field into raw form from the generic internal representation.
Parameter | Description |
---|---|
aHeader | (in) A proxy for the header field to be encoded |
CHeaderCodec * | FindDelegateCodecL | ( | RStringF | aHeaderField | ) | const [pure virtual] |
Intended Usage: Concrete header codecs must be implement this method if they wish to delegate the encoding/decoding of particular header fields to a different codec. This would be done if the codec doesn't have the ability itself to do the encode/decode but can locate an alternative that does. This function may leave with a Standard Symbian OS error code. eg. KErrNoMemory
Parameter | Description |
---|---|
aHeaderField | (in) A proxy for the header field to be encoded |
Returns: A pointer to the new CHeaderCodec, or NULL if one couldn't be found.