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

Deprecated

Constructor & Destructor Documentation

TWspHeaderSegmenter ( RStringPool, const TStringTable &, TPtrC8 )

TWspHeaderSegmenter(RStringPoolaPool,
const TStringTable &aStringTable,
TPtrC8aBuffer
)[inline]

Constructor

Pre-condition
The string table must be opened with the WSP Sting constants table
ParameterDescription
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.

CAUTION:

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

leave
RStringPool::OpenFStringL StringPool leave code if opening string fails.
ParameterDescription
aWspHeaderOut - a TWspField containing the header <name,value> pair.

Returns: KErrNone if next field is returned KErrNotFound at the end of the buffer - no TWspField param returned KErrCorrupt if segmenting does not parse correctly

Offset ( )

TInt Offset()const [inline]

Offset returns the current offset into the buffer being parsed.

Returns: 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.