|
||
class CWspHeaderEncoder : public CBase;
This class can be used to encode one header field at a time, with all its values and parameters.
It has no knowledge of encoding the BNF of a particular header field, but the functions provided can be used in combination, producing an 8-bit buffer containing the encoded header.
Intended usage would be to call a series of functions. The first one being StartHeader, The final one being EndHeader, which
would return a buffer containing the complete encoded header field. eg: encoder->CWspHeaderEncoder::StartHeaderL(TUint8)
; encoder->CWspHeaderEncoder::AddLongIntL(const TUint32)
; encoder->CWspHeaderEncoder::AddTextStringL(const RString &)
; HBufC8* output = encoder->CWspHeaderEncoder::EndHeaderL()
;
CBase
-
Base class for all classes to be instantiated on the heap.
CWspHeaderEncoder
- This class can be used to encode one header field at a time, with all its values...
Defined in CWspHeaderEncoder
:
AddDataL(const TDesC8 &)
Encodes input and adds it to the encoded field. Adds value as-is to the encoded ...AddDateL(const TDateTime)
Encodes input and adds it to the encoded field.Encodes parameter value using WSP...AddIntegerL(const TUint)
Encodes input Integer value and adds it to the encoded field. Choice of encoded ...AddLongIntL(const TUint32)
Encodes input and adds it to the encoded field. Encodes parameter value using WS...AddShortIntL(const TUint8)
Encodes input and adds it to the encoded field. Encodes parameter value using WS...AddShortLengthL(const TUint8)
Encodes input and adds it to the encoded field. For short length the value must ...AddTextStringL(const RString &)
Encodes input and adds it to the encoded field. Encodes parameter value using WS...AddTextStringL(const TDesC8 &)
Encodes input and adds it to the encoded field. Encodes parameter value using WS...AddTokenL(const TUint8)
Encodes input and adds it to the encoded field. Adds value as-is to the encoded ...AddTokenTextL(const TDesC8 &)
Encodes input and adds it to the encoded field. Encodes parameter value using WS...AddUintVarL(const TUint)
Encodes input and adds it to the encoded field. Encodes parameter value using WS...EndHeaderL()
Completes and returns encoded field 8 bit buffer. This method will panic if an C...EndValueLengthL()
Needs to be called at the point in the construction of a header when ValueLength...NewL()
Static factory constructor.NewLC()
Static factory constructor.StartHeaderL(TUint8)
Starts a new encoded header.StartHeaderL(const RStringF)
Starts a new encoded header.StartHeaderL(const TDesC8 &)
Starts a new encoded header.StartValueLengthL()
From calling this function, the length in bytes of all encodings added subsequen...~CWspHeaderEncoder()
Default destructor Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C static CWspHeaderEncoder* NewL();
Static factory constructor.
|
|
IMPORT_C static CWspHeaderEncoder* NewLC();
Static factory constructor.
|
|
IMPORT_C void StartHeaderL(TUint8 aToken);
Starts a new encoded header.
|
|
IMPORT_C void StartHeaderL(const TDesC8 &aString);
Starts a new encoded header.
|
|
IMPORT_C void StartHeaderL(const RStringF aString);
Starts a new encoded header.
|
|
IMPORT_C HBufC8* EndHeaderL();
The function StartHeaderL should have been called.
Completes and returns encoded field 8 bit buffer. This method will panic if an CWspHeaderEncoder::EndValueLengthL()
is not called after a StartValueLength().
Note: The final buffer containing the entire encoded header is constructed. Returns buffer containing the encoded field constructed from the first call to StartHeaderL.
Encoder is reset ready to be used again.
|
|
IMPORT_C void AddIntegerL(const TUint aInt);
StartHeaderL needs to have been called.
Encodes input Integer value and adds it to the encoded field. Choice of encoded form dependent on the size of the input.Either ShortInt or LongInt method chosen.
|
|
IMPORT_C void AddShortIntL(const TUint8 aValue);
StartHeaderL needs to have been called.
Encodes input and adds it to the encoded field. Encodes parameter value using WSP ShortInt method.
|
|
IMPORT_C void AddShortLengthL(const TUint8 aValue);
StartHeaderL needs to have been called.
Encodes input and adds it to the encoded field. For short length the value must be between octet 0 - 31.
|
|
IMPORT_C void AddLongIntL(const TUint32 aValue);
StartHeaderL needs to have been called.
Encodes input and adds it to the encoded field. Encodes parameter value using WSP LongInt method.
|
|
IMPORT_C void AddUintVarL(const TUint aInt);
StartHeaderL needs to have been called.
Encodes input and adds it to the encoded field. Encodes parameter value using WSP UIntVar method.
|
|
IMPORT_C void AddTextStringL(const RString &aText);
StartHeaderL needs to have been called.
Encodes input and adds it to the encoded field. Encodes parameter value using WSP TextString method.
|
|
IMPORT_C void AddTextStringL(const TDesC8 &aText);
StartHeaderL needs to have been called.
Encodes input and adds it to the encoded field. Encodes parameter value using WSP TextString method.
|
|
IMPORT_C void AddDateL(const TDateTime aDate);
StartHeaderL needs to have been called.
Encodes input and adds it to the encoded field.Encodes parameter value using WSP Date method.
|
|
IMPORT_C void AddTokenL(const TUint8 aToken);
StartHeaderL and StartValueLengthL should have been called.
Encodes input and adds it to the encoded field. Adds value as-is to the encoded field.
EndValueLengthL needs to be called subsequently.
|
IMPORT_C void AddTokenTextL(const TDesC8 &aTokenText);
Encodes input and adds it to the encoded field. Encodes parameter value using WSP TokenText method.
|
|
IMPORT_C void AddDataL(const TDesC8 &aData);
Encodes input and adds it to the encoded field. Adds value as-is to the encoded field.
|
|
IMPORT_C void StartValueLengthL();
StartHeaderL should have been called.
From calling this function, the length in bytes of all encodings added subsequently will be calculated and stored as part of the encoded string, as specified in WSP spec.Can be nested. i.e.
encoder->StartHeaderL();
encoder->StartValueLengthL();
encoder->StartValueLengthL();
encoder->AddLongIntL();
encoder->EndValueLengthL();
encoder->AddTextStringL();
encoder->EndValueLengthL();
HBufC8* output = encoder->EndHeaderL();
EndValueLengthL needs to be called subsequently.
|
IMPORT_C void EndValueLengthL();
StartHeaderL and StartValueLengthL should have been called.
Needs to be called at the point in the construction of a header when ValueLength can be calculated.
ValueLength has been calculated and added, together with the encoded header, to the internal representation of the header buffer.
|