RHeaderField Class Reference

#include <mw/http/framework/rheaderfield.h>

class RHeaderField
Public Member Functions
RHeaderField(CHeaderField &)
IMPORT_C voidBeginRawDataL(TInt)
IMPORT_C RHTTPHeadersCollection()
IMPORT_C voidCommitRawData()
IMPORT_C RStringFName()
IMPORT_C THeaderFieldPartIterPartsL()
IMPORT_C voidRawDataL(TPtrC8 &)
IMPORT_C voidSetPartL(CHeaderFieldPart *, TInt)
IMPORT_C voidWriteRawDataL(const TDesC8 &)
IMPORT_C voidWriteRawDataL(TChar)

Detailed Description

An proxy object for a single field in an HTTP header. The class is used by implementations of CHeaderCodec in order to manipulate the header at the part and parameter level, or to obtain raw data, during a header encode/decode operation.

Constructor & Destructor Documentation

RHeaderField ( CHeaderField & )

RHeaderField(CHeaderField &aHeaderField)[inline]

Member Function Documentation

BeginRawDataL ( TInt )

IMPORT_C voidBeginRawDataL(TIntaChunkSize =  KDefaultRawChunkSize )
When the header codec starts converting parsed header data into the raw form, it must first call this method to indicate that the raw data is being generated. Memory allocations are done in chunks set at the specified size. Note this method is for use only by the header codec.
Pre-condition
The header field is in the 'parsed' state
Post-condition
The header field is still in the 'parsed' state
Parameters
aChunkSize(in) (optional) The size to be used for raw data chunk allocation.

Collection ( )

IMPORT_C RHTTPHeadersCollection()

Get a handle to the headers collection that this field belongs to

Return Value
The header collection handle.

CommitRawData ( )

IMPORT_C voidCommitRawData()
Commits the Raw data. The parsed header parts and parameters are removed, leaving the field in a the raw data form. Note this method is for use only by the header codec.
Pre-condition
The header field is in the 'parsed' state
Post-condition
The header field is in the 'raw' state

Name ( )

IMPORT_C RStringFName()const

Obtain the name of the header field, e.g. Accept

Return Value
The header field name as a string

PartsL ( )

IMPORT_C THeaderFieldPartIterPartsL()
Access the header value parts via an iterator
Return Value
An iterator constructed to point at the first part
Leave Codes
KErrNotSupported- if decoding when counting parts fails

RawDataL ( TPtrC8 & )

IMPORT_C voidRawDataL(TPtrC8 &aRawData)
Get the header field's raw data representation. This will flip the internal state of the header, if it's not already in Raw form. Requires a Codec to be set. May leave due to decode failures with an error code from <httperr.h>
Post-condition
The header field is in either its 'raw' state (following a successful conversion) or in a 'corrupt' state if decoding failed.
Parameters
aRawData(inout) An 8-bit pointer descriptor that is set during the call to point at the data buffer representing the header in its raw form.
Leave Codes
KErrNotSupported- if decoding when counting parts fails

SetPartL ( CHeaderFieldPart *, TInt )

IMPORT_C voidSetPartL(CHeaderFieldPart *aPart,
TIntaIndex
)

Set a part in the header. It replaces any existing part at the specified index. Note this is for use only by the header codec, when converting Raw data into parsed header parts.

Parameters
aPart(in) The part to be added. The header takes ownership of the new part.
aIndex(in) The index within the header of field of the part.

WriteRawDataL ( const TDesC8 & )

IMPORT_C voidWriteRawDataL(const TDesC8 &aData)
Add more Raw data, supplied as a descriptor. The data is appended to the existing contents of the field's internal raw data buffer, which is extended as necessary. Note this method is for use only by the header codec.
Pre-condition
The header field is in the 'parsed' state
Post-condition
The header field is still in the 'parsed' state
Parameters
aData(in) The data to append to the buffer.

WriteRawDataL ( TChar )

IMPORT_C voidWriteRawDataL(TCharaData)
Add more Raw data, supplied as a single character. The data is appended to the existing contents of the field's internal raw data buffer, which is extended as necessary. Note this method is for use only by the header codec.
Pre-condition
The header field is in the 'parsed' state
Post-condition
The header field is still in the 'parsed' state
Parameters
aData(in) The character data to append to the buffer.