Symbian3/SDK/Source/GUID-7A9FBE3A-D75E-59FC-9ACD-196670F0F9C8.dita
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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-7A9FBE3A-D75E-59FC-9ACD-196670F0F9C8" xml:lang="en"><title>Constant
       
    13 literal text</title><shortdesc>Constant literals are objects containing constant literal text
       
    14 which can be placed by the compiler into read-only memory. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    15 <p>They are also referred to as <i>literal descriptors</i>. They are not true
       
    16 descriptors, they are <i>not</i> derived from the descriptor classes, but
       
    17 they do have conversion operators so that they can be passed to any function
       
    18 which takes a <codeph>const TDesC16&amp;</codeph> type, a <codeph>const TDesC8&amp;</codeph> type
       
    19 or a <codeph>const TDesC&amp;</codeph> type. </p>
       
    20 <p>Constant literal descriptors are constructed using the macros: </p>
       
    21 <ul>
       
    22 <li id="GUID-9C594461-1222-525B-B335-354CD88B10E8"><p> <codeph>_LIT16</codeph>  </p> </li>
       
    23 <li id="GUID-6B39451F-9F57-5B07-9092-6F4AFD0584F6"><p> <codeph>_LIT8</codeph>  </p> </li>
       
    24 <li id="GUID-32945A96-0230-5BCF-8504-738DD5608D57"><p> <codeph>_LIT</codeph>  </p> </li>
       
    25 </ul>
       
    26 <p>The <codeph>_L16</codeph>, <codeph>_L8</codeph> and <codeph>_L</codeph> macros,
       
    27 which perform a similar function, are retained for compatibility purposes,
       
    28 but all production code that requires literal text should use literal descriptors. </p>
       
    29 <section id="GUID-7CDEA4A3-7C16-4833-B048-2C08BDA04DA0"><title>_LIT16</title> <p>This macro constructs the 16 bit variant
       
    30 constant literal descriptor for Unicode strings. The literal descriptor object
       
    31 is an instance of a <codeph>TLitC16</codeph> class and the macro generates <codeph>const
       
    32 static           TLitC16</codeph> in the C++ code. </p> </section>
       
    33 <section id="GUID-A1FAD942-4009-43A2-B95B-FDB221656645"><title>_LIT8</title> <p>This macro constructs the 8 bit variant constant
       
    34 literal descriptor for non-Unicode strings. The literal descriptor object
       
    35 is an instance of a <codeph>TLitC8</codeph> class and the macro generates <codeph>const
       
    36 static           TLitC8</codeph> in the C++ code. </p> </section>
       
    37 <section id="GUID-285C1C21-C840-4A97-992B-F3F95D30F94B"><title>_LIT</title> <p>This macro constructs the build independent
       
    38 type constant literal descriptor. The literal descriptor object is an instance
       
    39 of a <codeph>TLitC</codeph> class and the macro generates <codeph>const static
       
    40           TLitC</codeph> in the C++ code. By using this type, the appropriate
       
    41 variant, either 16 bit or 8 bit is selected at build time depending on whether
       
    42 the <codeph>_UNICODE</codeph> macro has been defined or not. </p> </section>
       
    43 </conbody></concept>