Symbian3/PDK/Source/GUID-101A11B5-E9A2-4E6D-9D81-9BF76312521D.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 11 Mar 2010 18:02:22 +0000
changeset 3 46218c8b8afa
parent 1 25a17d01db0c
child 5 f345bda72bc4
permissions -rw-r--r--
week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-101A11B5-E9A2-4E6D-9D81-9BF76312521D" xml:lang="en"><title>WSP
Header Primitive Decoding</title><shortdesc><apiname>TWspPrimitiveDecoder</apiname> allows decoding the primitive
values of the header. This allows interpreting the encoded header.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<steps-unordered>
<step id="GUID-88138F7A-824B-422F-93CE-F3DA473624A1"><cmd/>
<info><p>Call <codeph>String()</codeph>, <codeph>Val7Bit()</codeph>, <codeph>LongInt()</codeph>, <codeph>Integer()</codeph>, <codeph>UIntVar()</codeph>, <codeph>LengthVal()</codeph>, <codeph>Date()</codeph> as appropriate to
get the required byte to which the buffer is currently pointing. Before calling
these functions, check if the data type that is passed to the functions is
one of the type supported by <xref href="GUID-2E4D864D-52DD-3B7A-9B4A-C9382CF2DACE.dita"><apiname>TWspHeaderType</apiname></xref>. To get the
type of the variable, call <codeph>VarType()</codeph>, which returns either <codeph>ELengthVal</codeph>, <codeph>EQuotedString</codeph>, <codeph>EString</codeph> or <codeph>E7BitVal</codeph> of <xref href="GUID-2E4D864D-52DD-3B7A-9B4A-C9382CF2DACE.dita"><apiname>TWspHeaderType</apiname></xref> as
appropriate. If no data type is set to the data it points, the function returns <codeph>ENotSet</codeph>. </p></info>
<stepxmp><codeblock xml:space="preserve">TPtrC8 aBuf;
TWspPrimitiveDecoder dec(aBuf);
TInt length;
// get length in bytes of data 
TInt int = dec.LengthVal(length);</codeblock></stepxmp>
<substeps id="GUID-2BBE7C92-553D-496A-982A-967370AF272F">
<substep id="GUID-C1C8DF08-EFCA-4185-83A4-4FEDDDE587AD"><cmd/>
<info><p>Decode the string value of the header using <codeph>String()</codeph>. </p></info>
<stepxmp><codeblock xml:space="preserve">TPtrC8 aBuf;
TWspPrimitiveDecoder dec(aBuf);
TPtrC8 str;
//get the string that the buffer is pointing to
TInt int = dec.String(str); </codeblock></stepxmp>
</substep>
<substep id="GUID-6F363AF0-AD00-4397-A7EE-ABCF3B0A0BD4"><cmd/>
<info><p>Decode the integer value of the header using <codeph>Integer()</codeph>. </p></info>
<stepxmp><codeblock xml:space="preserve">TPtrC8 aBuf;
TWspPrimitiveDecoder dec(aBuf);
TUint32 val;
// get the integer that the buffer is pointing to
TInt int = dec.Integer(val); </codeblock></stepxmp>
</substep>
<substep id="GUID-B8AB27CC-AE2C-400E-96AF-4030021883F1"><cmd/>
<info><p>Decode the integer value of the header using <codeph>UIntVar()</codeph>. </p></info>
<stepxmp><codeblock xml:space="preserve">TPtrC8 aBuf;
TWspPrimitiveDecoder dec(aBuf);
TUint32 val;
//get the TUint32 value of the header
TUint32 uInt =dec.UintVar(val);  </codeblock></stepxmp>
</substep>
</substeps>
</step>
</steps-unordered>
</taskbody></task>