Symbian3/PDK/Source/GUID-2CE8544C-470C-5693-8ED6-27B01DD9548B.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 11 Mar 2010 18:02:22 +0000
changeset 3 46218c8b8afa
parent 1 25a17d01db0c
child 5 f345bda72bc4
permissions -rw-r--r--
week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     6
<!-- Initial Contributors:
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     7
    Nokia Corporation - initial contribution.
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     8
Contributors: 
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
     9
-->
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    10
<!DOCTYPE concept
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    12
<concept xml:lang="en" id="GUID-2CE8544C-470C-5693-8ED6-27B01DD9548B"><title>How to parse a pathname</title><prolog><metadata><keywords/></metadata></prolog><conbody><section><title>Retrieving individual components</title> <p>The following code fragment shows how the individual components are extracted using the <codeph>TParseBase</codeph> functions:</p> <codeblock id="GUID-B1605907-E17B-57F6-B9BB-8D977E02376A" xml:space="preserve">_LIT(KPath,"c:\\wrd\\meeting.wrd");
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    13
...
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    14
TParse p;
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    15
p.Set(KPath,NULL,NULL);
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    16
p.Name();       // gives "meeting"
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    17
p.NameAndExt(); // gives "meeting.wrd"
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    18
...</codeblock> </section> <section><title>Component masking</title> <p><codeph>TParse</codeph> can be used to select components from different file and path specifications. The <codeph>Set()</codeph> function takes three arguments. They are each parsed into four components: drive, path, filename and extension.</p> <p>The example below sets up the <codeph>TParse</codeph> object so that it can be used to yield useful information.</p> <codeblock id="GUID-14D77BE2-C607-5018-A9B5-E7E4A54FB0F1" xml:space="preserve">_LIT(KSpec,"A:file1");
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    19
_LIT(KRelated,"C:\\path1\\related.xxx");
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    20
TParse fp;
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    21
fp.Set(KSpec,&amp;KRelated,NULL);</codeblock> <table id="GUID-31958460-AEB8-5876-806B-08982A62FE97"><tgroup cols="5"><colspec colname="col0"/><colspec colname="col1"/><colspec colname="col2"/><colspec colname="col3"/><colspec colname="col4"/><tbody><row><entry/><entry><p>drive</p> </entry> <entry><p>path</p> </entry> <entry><p>filename</p> </entry> <entry><p>extension</p> </entry> </row> <row><entry><p>file specification</p> </entry> <entry><p><filepath>A:</filepath> </p> </entry> <entry/><entry><p><filepath>file1</filepath> </p> </entry> <entry/></row> <row><entry><p>related name</p> </entry> <entry><p><filepath>C:</filepath> </p> </entry> <entry><p><filepath>\path1\</filepath> </p> </entry> <entry><p><filepath>related</filepath> </p> </entry> <entry><p><filepath>.xxx</filepath> </p> </entry> </row> <row><entry><p>default name</p> </entry> <entry/><entry/><entry/><entry/></row> <row><entry><p>result</p> </entry> <entry><p><filepath>A:</filepath> </p> </entry> <entry><p><filepath>\path1\</filepath> </p> </entry> <entry><p><filepath>file1</filepath> </p> </entry> <entry><p><filepath>.xxx</filepath> </p> </entry> </row> </tbody> </tgroup> </table> <p>The resulting <codeph>fp.fullname</codeph> will be <codeph>A:\path1\file1.xxx.</codeph> All the components that are specified in the file specification (drive and filename) are put into the result; any missing components (path and extension) are taken from the related file specification which has next order of precedence; nothing is specified in the default.</p> <p>The second example shows how wildcards are allowed in the filename and extension.</p> <codeblock id="GUID-17D1D396-FC67-5097-9165-B159F549BFC1" xml:space="preserve">    TParse fp;
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    22
    _LIT(KSpec,"A:file1");
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    23
    _LIT(KDefault,"C:\\path1\\*.*");
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    24
    fp.Set(KSpec,NULL,&amp;KDefault);</codeblock> <table id="GUID-9CEADC99-16FE-50FD-B401-AB595B91D48C"><tgroup cols="5"><colspec colname="col0"/><colspec colname="col1"/><colspec colname="col2"/><colspec colname="col3"/><colspec colname="col4"/><tbody><row><entry><p>  </p> </entry> <entry><p>drive</p> </entry> <entry><p>path</p> </entry> <entry><p>filename</p> </entry> <entry><p>extension</p> </entry> </row> <row><entry><p>file specification</p> </entry> <entry><p><filepath>A:</filepath> </p> </entry> <entry/><entry><p><filepath>file1</filepath> </p> </entry> <entry/></row> <row><entry><p>related filename</p> </entry> <entry/><entry/><entry/><entry/></row> <row><entry><p>default filename</p> </entry> <entry><p><filepath>C:</filepath> </p> </entry> <entry><p><filepath>\path1\</filepath> </p> </entry> <entry><p><filepath>*</filepath> </p> </entry> <entry><p><filepath>.*</filepath> </p> </entry> </row> <row><entry><p>result</p> </entry> <entry><p><filepath>A:</filepath> </p> </entry> <entry><p><filepath>\path1\</filepath> </p> </entry> <entry><p><filepath>file1</filepath> </p> </entry> <entry><p><filepath>.*</filepath> </p> </entry> </row> </tbody> </tgroup> </table> <p>The resulting <codeph>fp.fullname</codeph> will be <codeph>A:\path1\file1.*</codeph> </p> <p><b>Parsing with reference to the session default directory</b> </p> <p><codeph>TParse</codeph> operations occur without reference to the file server. Two <codeph>RFs::Parse()</codeph> functions perform a <codeph>TParse::Set()</codeph> using the session path as the <codeph>aDefault</codeph> argument : one of these variants specifies an <codeph>aRelated</codeph>, the other does not. Use these <codeph>RFs::Parse()</codeph> functions to parse filenames with reference to the session path.</p> </section> <section><title>Wildcard characters</title> <p>The <codeph>?</codeph> and <codeph>*</codeph> wildcard characters are supported to indicate a single character, and any sequence of characters. Both wildcard characters can be used any number of times in any part of any component of the file specification, except the drive. Although there is no intention that these will ever change, they are defined as the constants <codeph>KMatchOne</codeph> and <codeph>KMatchAny</codeph>.</p> </section> <section><title>Illegal paths</title> <p>The following restrictions apply to path components. If any are violated, <codeph>TParse</codeph> will return <codeph>KErrBadName</codeph>: </p> <ul><li id="GUID-A1BF9F97-F77C-54D1-AF22-EDB4E06699B6"><p>a path component which is followed by a trailing backslash must also be preceded by a backslash. For example, the following code will return an error because <filepath>DIR\</filepath> is neither a directory nor a file.</p> </li> </ul> <codeblock id="GUID-C7988B04-ECA0-5BED-B90E-2415C66F141B" xml:space="preserve">_LIT(KText,"DIR\\");
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    25
...
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    26
TInt r=parse.Set(KText,NULL,NULL);</codeblock> <ul><li id="GUID-8B2C6A24-A7AD-5210-8B33-F4E4C328BA57"><p>the length of any component (and the total path length) must not exceed 256 characters</p> </li> <li id="GUID-A10B9251-BF06-5FB3-A74F-E2E9F2B9A0EE"><p>spaces between the drive and the first directory in the path are illegal, although there may be spaces between other path components, for instance between the path or drive and filename, or within path components. The following code will return an error:</p> </li> </ul> <codeblock id="GUID-7036B814-8A5F-549F-B580-13383E424B20" xml:space="preserve">_LIT(KBadText,"C: \\DIR\\");
46218c8b8afa week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents: 1
diff changeset
    27
...
1
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    28
r=parse.Set(KBadText,NULL,NULL);</codeblock> <ul><li id="GUID-83462E03-77BF-5692-90AF-729ACE4B7C8E"><p>when using <codeph>TParse::SetNoWild()</codeph> no wildcard character may be present in the filename or extension.</p> </li> </ul> </section> </conbody></concept>