TWspHeaderSegmenter Class Reference

#include <wspdecoder.h>

class TWspHeaderSegmenter
Public Member Functions
TWspHeaderSegmenter(RStringPool, const TStringTable &, TPtrC8)
IMPORT_C TIntNextL(TWspField &)
TInt Offset()

Detailed Description

TWspHeaderSegmenter segments a WSP buffer into WSP header/value pairs. It detects boundaries between header/values based on the WAP-WSP spec.
  • To construct, buffer and string pool is passed in

  • Call to NextL() to iterate through the buffer - this returns a TWspField

  • NextL() returns KErrNotFound when done


Constructor & Destructor Documentation

TWspHeaderSegmenter ( RStringPool, const TStringTable &, TPtrC8 )

const TStringTable &aStringTable,


The string table must be opened with the WSP Sting constants table
aPoolIn - an opened RStringPool - owned by the caller
aStringTableIn - the string table in the string pool to use
aBufferIn - the buffer containing the WSP header data - owned by the caller

Member Function Documentation

NextL ( TWspField & )

IMPORT_C TIntNextL(TWspField &aWspHeader)

NextL iterates through the buffer. Each call returns a TWspField in the paramater.


The TWspField::iHdrName will be opened internally. It must be closed by the caller before this class is destroyed.

aWspHeaderOut - a TWspField containing the header <name,value> pair.
Return Value
KErrNone if next field is returned KErrNotFound at the end of the buffer - no TWspField param returned KErrCorrupt if segmenting does not parse correctly
Leave Codes

Offset ( )

TInt Offset()const [inline]

Offset returns the current offset into the buffer being parsed.

Return Value
TInt offset value. It will point to beginning of next segmented field. If NextL has not been called it will be set to 0. The beginning of the buffer. If buffer has been completely parsed, will return KErrNotFound.