Symbian3/SDK/Source/GUID-026E865E-12FA-59A9-B923-309B65790E23.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
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 task
       
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
       
    12 <task id="GUID-026E865E-12FA-59A9-B923-309B65790E23" xml:lang="en"><title>Creating
       
    13 a FAT Filename Conversion Plug-in</title><shortdesc>This section describes how to create a FAT Filename Conversion
       
    14 plug-in DLL. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <prereq><p>This tutorial assumes that you have an understanding of the following: </p> <ul>
       
    16 <li id="GUID-09E0AD13-A9EA-5A1B-956F-2AC4812F99FC"><p><xref href="GUID-66231EA2-BDEF-582D-A4B9-F356B590038D.dita">FAT
       
    17 Filename Conversion Plug-ins Overview</xref> introduces Windows code page
       
    18 and the main purpose of the Plug-ins component. </p> </li>
       
    19 </ul> </prereq>
       
    20 <context><p>The flowchart below shows the steps to create a Fat Filename Conversion
       
    21 plug-in DLL. </p> <fig id="GUID-B3799729-B2DB-55E3-AE09-E045A9E1AE8B">
       
    22 <image href="GUID-9482CC98-2600-539D-A243-639CF11A2599_d0e426712_href.jpg" placement="inline"/>
       
    23 </fig> <p> <b>Note</b>: To create the plug-in DLL, the <filepath>unicodeconv.cpp</filepath> file
       
    24 is needed. It provides the functions to convert text between Unicode and a
       
    25 foreign encoding. It is available on the <xref href="https://developer.symbian.org/xref/sfl/xref/MCL/sf/os/kernelhwsrv/userlibandfileserver/fatfilenameconversionplugins/src/" scope="external">Symbian Foundation</xref> web site. </p><p>This tutorial
       
    26 uses the example of <codeph>CP1250</codeph> to explain the process of creating
       
    27 a plug-in DLL. </p> </context>
       
    28 <steps id="GUID-8037DE6A-A5AB-575A-A9F5-0A6CB42651D4">
       
    29 <step id="GUID-21741F55-882F-51B9-BA77-EBFFED6B7D5E"><cmd>Create a source
       
    30 file using a text editor and save it as, for example <filepath>d:\charconvfiles\data\cp1250.txt</filepath>.
       
    31 This file contains pairs of hexadecimal numbers. The first number in each
       
    32 pair is the encoding of a character in CP1250 and the second is the Unicode
       
    33 encoding of the same character. </cmd>
       
    34 <stepxmp><codeblock id="GUID-D6C46177-19BC-5AB6-9E0D-FEC339F71948" xml:space="preserve">...
       
    35 0x00    0x0000    #NULL
       
    36 0x01    0x0001    #START OF HEADING
       
    37 0x02    0x0002    #START OF TEXT
       
    38 0x03    0x0003    #END OF TEXT
       
    39 0x04    0x0004    #END OF TRANSMISSION
       
    40 0x05    0x0005    #ENQUIRY
       
    41 0x06    0x0006    #ACKNOWLEDGE
       
    42 ...</codeblock> </stepxmp>
       
    43 <info>The source file has the same syntax as a cnvtool source file. For more
       
    44 information about the syntax, refer to <xref href="GUID-6796BA71-47A7-5465-89F2-BD0AEF2E4EE7.dita">Cnvtool
       
    45 Source File</xref>. </info>
       
    46 </step>
       
    47 <step id="GUID-10B9D3BB-7B21-5AC0-89B0-5E89C5796F11"><cmd/>
       
    48 <info>Start a command prompt to run the ConversionTable tool on the source
       
    49 as follows:<p><userinput><cmdname>cd </cmdname><parmname>d:\Symbian\epoc32\tools</parmname></userinput></p><p><userinput><cmdname>ConversionTable.pl </cmdname><parmname>d:\charconvfiles\data\cp1250.txt</parmname></userinput></p> </info>
       
    50 <info>This process generates a C++ source code file called <filepath>cp1250.cpp</filepath>.
       
    51 It is referred to as the ConversionTableTool-generated cpp file, which contains
       
    52 the data structure. The data structure is used by <filepath>unicodeconv.cpp</filepath> for
       
    53 the encoding conversion. </info>
       
    54 </step>
       
    55 <step id="GUID-D4F5D984-62E2-53F2-944E-E6E387ACA697"><cmd/>
       
    56 <info>Create an mmp file which is used to build the plug-in DLL. </info>
       
    57 <stepxmp><codeblock id="GUID-468B6E29-27BB-547B-A00A-5FF05D0A6E2C" xml:space="preserve">TARGET            cp1250.dll
       
    58 CAPABILITY            All
       
    59 TARGETTYPE            dll
       
    60 
       
    61 UID        0x100039e6 0x10206A9C
       
    62 VENDORID     0x70000001
       
    63 
       
    64 OS_LAYER_SYSTEMINCLUDE
       
    65 USERINCLUDE            ../inc
       
    66 
       
    67 SOURCEPATH            ../src
       
    68 SOURCE            unicodeconv.cpp
       
    69 
       
    70 SOURCEPATH            +/build/generated/fatcharsetconv
       
    71 SOURCE            cp1250.cpp
       
    72 
       
    73 DEFFILE             fatCnv.def
       
    74 
       
    75 LIBRARY            euser.lib
       
    76 
       
    77 SMPSAFE</codeblock> </stepxmp>
       
    78 </step>
       
    79 </steps>
       
    80 <postreq><p>Build the plug-in DLL and install it into the <filepath>\sys\bin\</filepath> directory.
       
    81 The DLL is then available to be loaded and called by the File Server.</p></postreq>
       
    82 </taskbody><related-links>
       
    83 <link href="GUID-2068DA42-AE77-5213-B3CF-C3AB7F2188BE.dita"><linktext>Using a FAT
       
    84 Filename Conversion Plug-in</linktext></link>
       
    85 </related-links></task>