TWspHeaderSegmenter Class Reference

class TWspHeaderSegmenter
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)

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

Constructor

Pre-condition
The string table must be opened with the WSP Sting constants table

Parameters

RStringPool aPoolIn - an opened RStringPool - owned by the caller
const TStringTable & aStringTableIn - the string table in the string pool to use
TPtrC8 aBufferIn - the buffer containing the WSP header data - owned by the caller

Member Functions 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.

Parameters

TWspField & aWspHeaderOut - a TWspField containing the header <name,value> pair.

Offset()

TInt Offset()const [inline]

Offset returns the current offset into the buffer being parsed.

Member Data Documentation

TPtrC8 iBuffer

TPtrC8 iBuffer[private]

Raw buffer that will be segmented - Not Owned

TInt iOffset

TInt iOffset[private]

Segment offset into the buffer.

RStringPool iPool

RStringPool iPool[private]

Opened string pool to use with the string table already loaded - Not Owned

const TStringTable & iStringTable

const TStringTable &iStringTable[private]

The string table to use in the string pool - Not Owned