8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE task |
10 <!DOCTYPE task |
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
12 <task id="GUID-101A11B5-E9A2-4E6D-9D81-9BF76312521D" xml:lang="en"><title>WSP |
12 <task id="GUID-101A11B5-E9A2-4E6D-9D81-9BF76312521D" xml:lang="en"><title>WSP |
13 Header Primitive Decoding</title><shortdesc><apiname>TWspPrimitiveDecoder</apiname> allows decoding the primitive |
13 Header Primitive Decoding</title><shortdesc><codeph>TWspPrimitiveDecoder</codeph> allows decoding the primitive |
14 values of the header. This allows interpreting the encoded header.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
14 values of the header. This allows interpreting the encoded header.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
15 <steps-unordered> |
15 <steps-unordered> |
16 <step id="GUID-88138F7A-824B-422F-93CE-F3DA473624A1"><cmd/> |
16 <step id="GUID-88138F7A-824B-422F-93CE-F3DA473624A1"><cmd/> |
17 <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 |
17 <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 |
18 get the required byte to which the buffer is currently pointing. Before calling |
18 get the required byte to which the buffer is currently pointing. Before calling |
19 these functions, check if the data type that is passed to the functions is |
19 these functions, check if the data type that is passed to the functions is |
20 one of the type supported by <xref href="GUID-2E4D864D-52DD-3B7A-9B4A-C9382CF2DACE.dita"><apiname>TWspHeaderType</apiname></xref>. To get the |
20 one of the type supported by <xref href="GUID-2E4D864D-52DD-3B7A-9B4A-C9382CF2DACE.dita"><apiname>TWspHeaderType</apiname></xref>. To get the |
21 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 |
21 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. |
22 appropriate. If no data type is set to the data it points, the function returns <codeph>ENotSet</codeph>. </p></info> |
22 If no data type is set to the data it points, the function returns <codeph>ENotSet</codeph>. </p></info> |
23 <stepxmp><codeblock xml:space="preserve">TPtrC8 aBuf; |
23 <stepxmp><codeblock xml:space="preserve">TPtrC8 aBuf; |
24 TWspPrimitiveDecoder dec(aBuf); |
24 TWspPrimitiveDecoder dec(aBuf); |
25 TInt length; |
25 TInt length; |
26 // get length in bytes of data |
26 // get length in bytes of data |
27 TInt int = dec.LengthVal(length);</codeblock></stepxmp> |
27 TInt int = dec.LengthVal(length);</codeblock></stepxmp> |