Symbian3/SDK/Source/GUID-5B1A7CBF-40DE-56F9-B145-948C6F72B647.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     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-5B1A7CBF-40DE-56F9-B145-948C6F72B647" xml:lang="en"><title>Using
       
    13 TDesC16 Class</title><shortdesc>Use <apiname>TDesC16</apiname> for interfaces which access Unicode
       
    14 text, regardless of the build variant, but which does not change the data.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    15 <section id="GUID-E63C406D-E480-59B0-B829-3838DDE6B24F"><title>Using in a
       
    16 function interface</title> <p>Interfaces which take wide (Unicode) text, use
       
    17 descriptors in the specification of that interface. All 16 bit concrete descriptors
       
    18 are derived from <codeph>TDesC16</codeph> which means that the interface can
       
    19 accept any 16 bit descriptor.</p> <p>The following code fragment shows the
       
    20 most common function prototype pattern.</p> <codeblock id="GUID-22E802FF-CFDD-52EB-87FD-90BE56022243" xml:space="preserve">void ClassX::foo(const TDesC16&amp; anArg);</codeblock> <p>The use of <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita"><apiname>TDesC16</apiname></xref> ensures that the data cannot be
       
    21 modified through the descriptor; <codeph>const</codeph> is an extra guarantee
       
    22 that the data cannot be changed.</p> <p>In practice, nearly all code uses
       
    23 the build independent form, <codeph>TDesC</codeph>, unless an explicit 8 bit
       
    24 or 16 bit build variant is required.</p> </section>
       
    25 <section id="GUID-149EA2C7-E0A6-5AF6-BF63-9F07AAE1F0C2"><title>Extract leftmost
       
    26 part of data</title> <p>The code fragment shows how the leftmost part of data
       
    27 in a descriptor can be accessed, using the <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-FC14F917-66BE-352A-84ED-27478C3D3962"><apiname>TDesC16::Left()</apiname></xref> member
       
    28 function.</p> <p>The behaviour is the same for the build independent variant, <xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>,
       
    29 replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>, <xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with <xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref> and <xref href="GUID-8FE95467-D48B-3E61-9028-29C0F15F567E.dita"><apiname>TPtrC16</apiname></xref> with <xref href="GUID-5CD07A27-E3ED-3273-A560-680501468C91.dita"><apiname>TPtrC</apiname></xref>.</p> <codeblock id="GUID-92E42C6C-47A6-5216-88BC-689869F6D5C9" xml:space="preserve">_LIT16(KData,"abcdefg");
       
    30 TBufC16&lt;8&gt; str(KData);
       
    31 ...
       
    32 str.Left(4);</codeblock> <p>The call to <codeph>Left()</codeph> returns a
       
    33 non-modifiable pointer descriptor representing the data string "<codeph>abcd</codeph>";
       
    34 this has length 4. The original data contained in, and represented by, the
       
    35 non-modifiable buffer descriptor <codeph>str</codeph>, is not changed in any
       
    36 way.</p> <codeblock id="GUID-9BF55CB5-45D1-5B90-8E3E-3BF704B0CB55" xml:space="preserve">_LIT16(KData,"abcdefg");
       
    37 TBufC16&lt;8&gt; str(KData);
       
    38 ...
       
    39 str.Left(256);</codeblock> <p>This call to <codeph>Left()</codeph> returns
       
    40 a non-modifiable pointer descriptor representing the data string "<codeph>abcdefg</codeph>",
       
    41 i.e. the whole content of the descriptor <codeph>str</codeph>; this has length
       
    42 7.</p> <p>Note that the following call to <codeph>Left()</codeph> results
       
    43 in a panic.</p> <codeblock id="GUID-E74C6BA7-5676-55DA-8EDF-21D0C3F44CED" xml:space="preserve">_LIT16(KData,"abcdefg");
       
    44 TBufC16&lt;8&gt; str(KData);
       
    45 ...
       
    46 str.Left(-1);           // Panic !</codeblock> </section>
       
    47 <section id="GUID-EE79E69C-3F7A-5AF8-9781-434A496255CA"><title>Extract rightmost
       
    48 part of data</title> <p>The code fragment shows how the right most part of
       
    49 data in a descriptor can be accessed, using the <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-97097CD2-B179-3D51-874F-3CE7A9D761F0"><apiname>TDesC16::Right()</apiname></xref> member
       
    50 function.</p> <p>The behaviour is the same for the build independent variant, <xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>,
       
    51 replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>, <xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with <xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref> and <xref href="GUID-8FE95467-D48B-3E61-9028-29C0F15F567E.dita"><apiname>TPtrC16</apiname></xref> with <xref href="GUID-5CD07A27-E3ED-3273-A560-680501468C91.dita"><apiname>TPtrC</apiname></xref>.</p> <codeblock id="GUID-41C7F212-E677-585E-80B1-3DED21E48537" xml:space="preserve">_LIT16(KData,"abcdefg");
       
    52 TBufC16&lt;8&gt; str(KData);
       
    53 ...
       
    54 str.Right(4);</codeblock> <p>The call to <codeph>Right()</codeph> returns
       
    55 a non-modifiable pointer descriptor representing the data string "<codeph>defg</codeph>";
       
    56 this has length 4. The original data contained in, and represented by, the
       
    57 non-modifiable buffer descriptor <codeph>str</codeph>, is not changed in any
       
    58 way.</p> <codeblock id="GUID-6663CDF1-93F6-50DE-8A1A-E1F30F4528F2" xml:space="preserve">_LIT16(KData,"abcdefg");
       
    59 TBufC16&lt;8&gt; str(KData);
       
    60 ...
       
    61 str.Right(256);</codeblock> <p>This call to <codeph>Right()</codeph> returns
       
    62 a non-modifiable pointer descriptor representing the data string "<codeph>abcdefg</codeph>".
       
    63 The whole content of the descriptor <codeph>str</codeph> has the length 7.</p> <p>Note
       
    64 that the following call to <codeph>Right()</codeph> results in a panic.</p> <codeblock id="GUID-2F9ADE78-9CA5-5032-95E0-5497687FC8FE" xml:space="preserve">_LIT16(KData,"abcdefg");
       
    65 TBufC16&lt;8&gt; str(KData);
       
    66 ...
       
    67 str.Right(-1);          // Panic !</codeblock> </section>
       
    68 <section id="GUID-A7393084-990B-5C51-A5FF-B9C4182ECAE0"><title>Extract middle
       
    69 portion of the data</title> <p>The code fragment shows how a portion of data
       
    70 within a descriptor can be accessed, using the <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-76B4CCFB-F592-3A80-87FE-ACD868172F3C"><apiname>TDesC16::Mid()</apiname></xref> member
       
    71 function. Each call to<codeph>Mid()</codeph> returns a non-modifiable pointer
       
    72 descriptor representing the selected portions of data.</p> <p>The behaviour
       
    73 is the same for the build independent variant,<xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>, replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>,<xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with<xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref> and<xref href="GUID-8FE95467-D48B-3E61-9028-29C0F15F567E.dita"><apiname>TPtrC16</apiname></xref> with <xref href="GUID-5CD07A27-E3ED-3273-A560-680501468C91.dita"><apiname>TPtrC</apiname></xref>.</p> <codeblock id="GUID-7A669FDC-DE36-54C0-878F-0E8C4D9A3246" xml:space="preserve">_LIT16(KData,"abcdefg");
       
    74 TBufC16 str(KData);
       
    75 ...
       
    76 str.Mid(0);   //returns TPtrC16 representing "abcdefg"; length is 7
       
    77 str.Mid(1);   //returns TPtrC16 representing "bcdefg";  length is 6
       
    78 str.Mid(6);   //returns TPtrC16 representing "g";       length is 1
       
    79 str.Mid(3,3); //returns TPtrC16 representing "def";     length is 3
       
    80 str.Mid(0,7); //returns TPtrC16 representing "abcdefg"; length is 7
       
    81 ...
       
    82 str.Mid(8); // Panics !
       
    83 str.Mid(3,5); // Panics !</codeblock> </section>
       
    84 <section id="GUID-5506FF14-B12F-5CB8-9613-DFCF678BDB57"><title>Comparing data</title> <p>This
       
    85 code fragment shows the<xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-AD5D7B9B-527C-324F-B399-4AEDA0432D4B"><apiname>TDesC16::Compare()</apiname></xref> function.</p> <p>The
       
    86 behaviour is the same for the build independent variant,<xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>,
       
    87 replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>, <xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with<xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref>.</p> <codeblock id="GUID-D3F03C22-0D4C-5C76-A10E-90B4B330F04B" xml:space="preserve">_LIT16(Kabcd,  "abcd");
       
    88 _LIT16(Kabcde, "abcde");
       
    89 _LIT16(Kabc,   "abc");
       
    90 _LIT16(Kabcx,  "abcx");
       
    91 ...
       
    92 TBufC16&lt;8&gt; str(Kabcd);
       
    93 ...
       
    94 str.Compare(Kabcde);    // returns -ve
       
    95 str.Compare(Kabc);      // returns +ve
       
    96 str.Compare(Kabcd);     // returns zero
       
    97 str.Compare(Kabcx);     // returns -ve</codeblock> <p>This result of the comparison
       
    98 means that:</p> <ul>
       
    99 <li id="GUID-902AA635-E5DD-5806-B1C3-E6D4CD6531C8"><p>"abcd" is less than
       
   100 "abcde".</p> </li>
       
   101 <li id="GUID-BD9A0EE3-F924-5C1F-88AF-A5A56B22B0B5"><p>"abcd" is greater than
       
   102 "abc".</p> </li>
       
   103 <li id="GUID-140D551D-F465-53AD-9FB8-0DBA1CB7FB29"><p>"abcd" is equal to "abcd".</p> </li>
       
   104 <li id="GUID-48853EF5-D2A1-55C6-92A3-1308BEE49FD0"><p>"abcd" is less than
       
   105 "abcx".</p> </li>
       
   106 </ul> </section>
       
   107 <section id="GUID-8E3F058A-4E53-5608-BEE0-69531AB28A5E"><title>Locating a
       
   108 character</title> <p>This code fragment shows the<xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-76F6497A-6353-3CF6-AB30-41E02EDC916A"><apiname>TDesC16::Locate()</apiname></xref> function.</p> <p>The
       
   109 behaviour is the same for the build independent variant,<xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>,
       
   110 replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>, <xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with<xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref>.</p> <codeblock id="GUID-212A32BC-BBA0-5A1D-92C2-D9CF9609379F" xml:space="preserve">_LIT16(Kabcd,"abcd");
       
   111 TBufC16&lt;8&gt; str(Kabcd);
       
   112 ...
       
   113 str.Locate('d');   // returns 3
       
   114 str.Locate('a');   // returns 0
       
   115 str.Locate('b');   // returns 1
       
   116 str.Locate('x');   // returns KErrNotFound</codeblock> </section>
       
   117 <section id="GUID-942CD420-E5A1-5A11-BC21-E895294CDDEB"><title>Finding data</title> <p>This
       
   118 code fragment shows the <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-3C5D15A1-E09F-34A5-A4E9-FEE36CED32B5"><apiname>TDesC16::Find()</apiname></xref> function.</p> <p>The
       
   119 behaviour is the same for the build independent variant,<xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>,
       
   120 replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>, <xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with<xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref>.</p> <codeblock id="GUID-764360D8-EA0F-5B7D-939B-235F249C169E" xml:space="preserve">_LIT16(KAtoZ,"abcdefghijklmnopqrstuvwxyz");
       
   121 TBufC16&lt;32&gt; str(KAtoZ);
       
   122 ...
       
   123 _LIT16(KFind1,"abc");
       
   124 str.Find(KFind1);            // returns 0
       
   125 
       
   126 _LIT16(KFInd2,"bcde");
       
   127 str.Find(KFInd2);            // returns 1
       
   128 
       
   129 _LIT16(KFind3,"uvwxyz");
       
   130 str.Find(KFind3);            // returns 20
       
   131 
       
   132 _LIT16(KFind4,"0123");
       
   133 str.Find(KFind4);            // returns KErrNotFound
       
   134 
       
   135 _LIT16(KFind5,"abcdefghijklmnopqrstuvwxyz01");
       
   136 str.Find(KFind5);            // returns KErrNotFound
       
   137 
       
   138 str.Find(KNullDesC16);       // returns 0</codeblock> </section>
       
   139 <section id="GUID-35A35FA8-F8CF-59F7-AEF6-23F340E5E9EE"><title>Pattern matching</title> <p>This
       
   140 code fragment shows the <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-D104D885-DB49-30CD-A78D-2E10A783CA93"><apiname>TDesC16::Match()</apiname></xref> function.</p> <p>The
       
   141 behaviour is the same for the build independent variant,<xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>,
       
   142 replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>, <xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with<xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref>.</p> <codeblock id="GUID-465DAB75-DFA3-5BE9-AC38-4548C9395334" xml:space="preserve">_LIT16(KAtoZ,"abcdefghijklmnopqrstuvwxyz");
       
   143 TBufC16&lt;32&gt; str(KAtoZ);
       
   144     ...
       
   145 _LIT16(KMatch1,"*ijk*");
       
   146 str.Match(KMatch1);          //returns -&gt; 8
       
   147 
       
   148 _LIT16(KMatch2,"*i?k*");
       
   149 str.Match(KMatch2);          //        -&gt; 8
       
   150 
       
   151 _LIT16(KMatch3,"ijk*");
       
   152 str.Match(KMatch3);          //        -&gt; KErrNotFound
       
   153 
       
   154 _LIT16(KMatch4,"abcd");
       
   155 str.Match(KMatch4);          //        -&gt; KErrNotFound
       
   156 
       
   157 _LIT16(KMatch5,"*i*mn*");
       
   158 str.Match(KMatch5);          //        -&gt; 8
       
   159 
       
   160 _LIT16(KMatch6,"abcdef*");
       
   161 str.Match(KMatch6);          //        -&gt; 0
       
   162 
       
   163 _LIT16(KMatch7,"*");
       
   164 str.Match(KMatch7);          //        -&gt; 0
       
   165 
       
   166 _LIT16(KMatch8,"*y*");
       
   167 str.Match(KMatch8);          //        -&gt; 24
       
   168 
       
   169 _LIT16(KMatch9,"*i??k*");
       
   170 str.Match(KMatch9);          //        -&gt; KErrNotFound</codeblock> <p>To test
       
   171 for the existence of a pattern within a text string, the pattern must start
       
   172 and end with an ‘*’.</p> </section>
       
   173 <section id="GUID-0C41371C-F933-55A5-A56A-46C14D8E0072"><title>Referencing
       
   174 a data item</title> <p>The code fragment shows how a data item can be referenced
       
   175 using<xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-1AA9098F-02ED-3305-B7B3-02A495A245A2"><apiname>TDesC16::operator[]()</apiname></xref>.</p> <p>The behaviour is the
       
   176 same for the build independent variant,<xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>, replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>, <xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with<xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref>.</p> <codeblock id="GUID-36DC1901-DE68-539C-8B9C-018D8C4DDBA5" xml:space="preserve">_LIT16(KData,"abcdefg");
       
   177 TBufC16&lt;8&gt; str(KData);
       
   178 ...
       
   179 str[0];                 // returns reference to 'a'
       
   180 str[3];                 // returns reference to 'd'
       
   181 str[7];                 // Panics !!</codeblock> </section>
       
   182 <section id="GUID-1885CDFC-D55F-596E-9BB4-D4BCB509FEB6"><title>Creating a
       
   183 heap descriptor</title> <p>The code fragments show how a heap descriptor is
       
   184 created from an existing descriptor using the <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23/GUID-9F44916A-1E89-350C-B831-79AF4D07CB15"><apiname>TDesC16::AllocL()</apiname></xref> member
       
   185 function.</p> <p>The behaviour is the same for the build independent variant,<xref href="GUID-52D07F46-2162-380C-A775-C3BB335C42F5.dita"><apiname>TDesC</apiname></xref>,
       
   186 replacing <xref href="GUID-B7343D82-C251-3C27-A1E4-79B628F2D593.dita"><apiname>_LIT16</apiname></xref> with <xref href="GUID-B47B3E37-4FAC-327C-B626-49E09DB147FC.dita"><apiname>_LIT</apiname></xref>,<xref href="GUID-44622E86-313E-36B3-9989-3016F8E6E252.dita"><apiname>TBufC16</apiname></xref> with<xref href="GUID-4D64E4B7-6BEE-3900-A115-460FE5B2D79E.dita"><apiname>TBufC</apiname></xref> and<xref href="GUID-3D3D9CD7-C8FD-3F81-9CC5-1A71D4F9751E.dita"><apiname>HBufC16</apiname></xref> with <xref href="GUID-A103FB19-60B3-3E45-97A5-1F295934ACA1.dita"><apiname>HBufC</apiname></xref>.</p> <codeblock id="GUID-DDC25AE2-0F9C-54E7-BDF5-0BCD0AA0BE41" xml:space="preserve">_LIT16(KData,"abcdefg");
       
   187 TBufC16&lt;16&gt; str(KData);
       
   188 ...
       
   189 HBufC16* ptr;
       
   190 ...
       
   191 ptr = str.AllocL();     //Creates and returns address of
       
   192 ...                     //heap descriptor. The new heap descriptor
       
   193 ...                     //contains a copy of the original data.
       
   194 ptr-&gt;Length();          //Returns 7; the length of "abcdfeg"</codeblock> </section>
       
   195 </conbody><related-links>
       
   196 <link href="GUID-7830BAAB-40DD-5E55-84B5-8DCA888E68E7.dita#GUID-7830BAAB-40DD-5E55-84B5-8DCA888E68E7/GUID-235E272D-6F5A-5740-8150-9698C8C8D55D">
       
   197 <linktext>Using TDesC in a function interface</linktext></link>
       
   198 </related-links></concept>