Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: WSPDecoder.h
Link against: inetprotutil.lib

Class TWspPrimitiveDecoder

class TWspPrimitiveDecoder;

Description

Decoder for WSP Primitves - WAP-WSP Section 8.4.1

Members

Defined in TWspPrimitiveDecoder:
Date(), E7BitVal, ELengthVal, ENotSet, EQuotedString, EString, Integer(), LengthVal(), LongInt(), String(), TWspHeaderType, TWspPrimitiveDecoder(), UintVar(), Val7Bit(), VarType(), VersionL()


Construction and destruction


TWspPrimitiveDecoder()

inline TWspPrimitiveDecoder(TPtrC8 aBuffer);

Description

Constructor

Parameters

TPtrC8 aBuffer

[Top]


Member functions


VarType()

IMPORT_C TWspHeaderType VarType() const;

Description

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

Return value

TWspHeaderType

TWspHeaderType - the type of this data octet


LengthVal()

IMPORT_C TInt LengthVal(TInt &aVal);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal

Description

Returns length of the data following this byte.

Post-Condition

internal offset gets updated to move past this primitive

Parameters

TInt &aVal

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.


String()

IMPORT_C TInt String(TPtrC8 &aString);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspType::EString

Description

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.

Post-Condition

internal offset gets updated to move past this primitive

Parameters

TPtrC8 &aString

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.


Val7Bit()

IMPORT_C TInt Val7Bit(TUint8 &aVal);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::E7BitVal

Description

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

Post-Condition

internal offset gets updated to move past this primitive

Parameters

TUint8 &aVal

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.


Integer()

IMPORT_C TInt Integer(TUint32 &aVal);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal or VarType() == TWspHeaderType::E7BitVal

Description

Returns an Integer - could be short or long.

Post-Condition

internal offset gets updated to move past this primitive

Parameters

TUint32 &aVal

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.


LongInt()

IMPORT_C TInt LongInt(TUint32 &aVal);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal

Description

Returns a long int the buffer is currently pointing at.

Post-Condition

internal offset gets updated to move past this primitive

Parameters

TUint32 &aVal

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.


UintVar()

IMPORT_C TInt UintVar(TUint32 &aVal);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal or VarType() == TWspHeaderType::E7BitVal

Description

Returns a TUint32

Post-Condition

internal offset gets updated to move past this primitive

Parameters

TUint32 &aVal

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.


VersionL()

IMPORT_C TInt VersionL(RStringPool aPool, RStringF &aVer);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal

Description

Returns a formatted version string

Post-Condition

internal offset gets updated to move past this primitive

Parameters

RStringPool aPool

RStringF &aVer

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.


Date()

IMPORT_C TInt Date(TDateTime &aDateTime);

Pre-Condition

iBuffer[iOffset] must be valid, VarType() == TWspHeaderType::ELengthVal

Description

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).

Post-Condition

internal offset gets updated to move past this primitive

Parameters

TDateTime &aDateTime

Return value

TInt

postive number indicating the number of bytes read from the buffer KErrCorrupt if data is not formatted correctly.

[Top]


Member enumerations


Enum TWspHeaderType

TWspHeaderType

Description

TWspHeaderType describe the types from WAP-WSP Section 8.4.1.2

ENotSet

ELengthVal

EQuotedString

EString

E7BitVal