TWspPrimitiveDecoder Class Reference

#include <wspdecoder.h>

class TWspPrimitiveDecoder
Public Member Enumerations
enumTWspHeaderType { ENotSet, ELengthVal, EQuotedString, EString, E7BitVal }
Public Member Functions
TWspPrimitiveDecoder(TPtrC8)
IMPORT_C TIntDate(TDateTime &)
IMPORT_C TIntInteger(TUint32 &)
IMPORT_C TIntLengthVal(TInt &)
IMPORT_C TIntLongInt(TUint32 &)
IMPORT_C TIntString(TPtrC8 &)
IMPORT_C TIntUintVar(TUint32 &)
IMPORT_C TIntVal7Bit(TUint8 &)
IMPORT_C TWspHeaderTypeVarType()
IMPORT_C TIntVersionL(RStringPool, RStringF &)

Detailed Description

Decoder for WSP Primitves - WAP-WSP Section 8.4.1 Deprecated

Member Enumeration Documentation

Enum TWspHeaderType

TWspHeaderType describe the types from WAP-WSP Section 8.4.1.2

EnumeratorValueDescription
ENotSet

The type has not been set

ELengthVal

0-31 - octet is a value length

EQuotedString

34 - value is a quoted text string, terminated by a Null

EString

32-127 - value is a text string, terminated by a Null

E7BitVal

128-255 - encoded 7 bit value, this header has no more data

Constructor & Destructor Documentation

TWspPrimitiveDecoder ( TPtrC8 )

TWspPrimitiveDecoder(TPtrC8aBuffer)[inline]

Constructor

Parameters
aBufferIn - the buffer containing the value in its raw format

Member Function Documentation

Date ( TDateTime & )

IMPORT_C TIntDate(TDateTime &aDateTime)

Returns a TDateTime offset from January 1, 1970 - WAP WSP Section 8.4.2.3 Panics if the time val is greater then the maximum allowable integer size (32 bits).

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal
Post-condition
internal offset gets updated to move past this primitive
Parameters
aDateTimeOut - a WAP Date
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

Integer ( TUint32 & )

IMPORT_C TIntInteger(TUint32 &aVal)

Returns an Integer - could be short or long.

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal or VarType() == TWspHeaderType::E7BitVal
Post-condition
internal offset gets updated to move past this primitive
Parameters
aValOut - the long int
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

LengthVal ( TInt & )

IMPORT_C TIntLengthVal(TInt &aVal)

Returns length of the data following this byte.

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal
Post-condition
internal offset gets updated to move past this primitive
Parameters
aValOut - the length encoded in this byte that indicates the size of the data that follows.
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

LongInt ( TUint32 & )

IMPORT_C TIntLongInt(TUint32 &aVal)

Returns a long int the buffer is currently pointing at.

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal
Post-condition
internal offset gets updated to move past this primitive
Parameters
aValOut - the long int
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

String ( TPtrC8 & )

IMPORT_C TIntString(TPtrC8 &aString)

Returns a TPtrC holding the string the buffer currently points at without the NULL termination. If the String type is a quoted string then the quotes are not included in the returned buffer.

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspType::EString
Post-condition
internal offset gets updated to move past this primitive
Parameters
aStringOut - the string
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

UintVar ( TUint32 & )

IMPORT_C TIntUintVar(TUint32 &aVal)

Returns a TUint32

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal or VarType() == TWspHeaderType::E7BitVal
Post-condition
internal offset gets updated to move past this primitive
Parameters
aValOut - the TUint32 decoded
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

Val7Bit ( TUint8 & )

IMPORT_C TIntVal7Bit(TUint8 &aVal)

Returns a token, a short int or an octet value with the top bit cleared

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::E7BitVal
Post-condition
internal offset gets updated to move past this primitive
Parameters
aValOut - the 7 bit value with top bit cleared
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

VarType ( )

IMPORT_C TWspHeaderTypeVarType()const

Looks at the byte currently pointed at in this buffer and returns the type.

Return Value
TWspHeaderType - the type of this data octet

VersionL ( RStringPool, RStringF & )

IMPORT_C TIntVersionL(RStringPoolaPool,
RStringF &aVer
)

Returns a formatted version string

Pre-condition
iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal
Post-condition
internal offset gets updated to move past this primitive
Parameters
aPoolIn - an opened string pool
aVerOut - a formatted version string. Caller must close this string.
Return Value
postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.