|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-93AB9273-08A5-52CD-AFF7-8B92D72067BF" xml:lang="en"><title>Using |
|
13 TDes</title><shortdesc>Use TDes for interfaces which take narrow or wide (Unicode) text, |
|
14 depending on the build variant.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <section id="GUID-3B3CC723-0555-5FCD-8783-F1467BB1191C"><title>Usage in a |
|
16 function interface</title> <p>An interface which needs to access and modify |
|
17 either narrow text or wide (Unicode) text, depending on the build variant, |
|
18 uses a <xref href="GUID-49D4E917-57EA-39AE-8941-144AA8AC2584.dita"><apiname>TDes</apiname></xref> as the argument type. All build independent |
|
19 concrete descriptors are derived from <codeph>TDes</codeph> which means that |
|
20 the interface can accept any build independent descriptor.</p> <p>The following |
|
21 code fragment shows the most common function prototype pattern.</p> <codeblock id="GUID-87812092-5582-51F4-B67B-9A2F503C0A26" xml:space="preserve">void ClassX::foo(TDes& anArg);</codeblock> <p>The |
|
22 use of <codeph>TDes</codeph> means that data can be accessed and modified |
|
23 through the descriptor.</p> <p>If the interface is to handle explicit 8 bit |
|
24 or explicit 16 bit data, regardless of the build variant, then use <xref href="GUID-445B19E5-E2EE-32E2-8D6C-C7D6A9B3C507.dita"><apiname>TDes8</apiname></xref> or <xref href="GUID-C04A9A0C-DBA7-37DA-B744-54FBF3D544CD.dita"><apiname>TDes16</apiname></xref> instead.</p> </section> |
|
25 </conbody><related-links> |
|
26 <link> |
|
27 <desc><xref href="GUID-3D73DD8F-8D23-5D47-A4F7-3673C993EF8F.dita">Using class TDes8</xref></desc> |
|
28 </link> |
|
29 <link href="GUID-0B6C97D3-0E2D-5BBE-B8AC-985902715160.dita"><linktext>Using Class |
|
30 TDes16</linktext></link> |
|
31 </related-links></concept> |