Location:
cheadercodec.h
Link against: http.lib
class CHeaderCodec : public CBase;
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.
CBase
- Base class for all classes to be instantiated on the heap
CHeaderCodec
- An abstract HTTP header codec
Defined in CHeaderCodec
:
CHeaderCodec()
, CanDecode()
, CanEncode()
, ConstructL()
, DecodeHeaderL()
, EncodeHeaderL()
, FindDelegateCodecL()
, Reserved1()
, Reserved2()
, iReader
, iWriter
, ~CHeaderCodec()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
virtual IMPORT_C ~CHeaderCodec();
Intended Usage: Destructor - cleans up and releases resources to the system.
protected: IMPORT_C void ConstructL();
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 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.
|
|
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.
|
|
virtual TBool CanEncode(RStringF aHeaderField) const=0;
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.
|
|
virtual TBool CanDecode(RStringF aHeaderField) const=0;
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.
|
|
virtual CHeaderCodec *FindDelegateCodecL(RStringF aHeaderField) const=0;
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
The caller takes ownership of the returned codec.
|
|
|
private: inline virtual void Reserved1();
Intended Usage: Reserve a slot in the v-table to preserve future BC
private: inline virtual void Reserved2();
Intended Usage: Reserve a slot in the v-table to preserve future BC
protected: CHeaderWriter * iWriter;
The owned header writer object that does actual encoding of header fields.
protected: CHeaderReader * iReader;
The owned header reader object that does actual decoding of header fields.