Symbian3/SDK/Source/GUID-A9EA16CE-2F80-5344-827D-0C2ED5812788.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-A9EA16CE-2F80-5344-827D-0C2ED5812788" xml:lang="en"><title>File
Store Type and Layout</title><shortdesc>File stores can be given a unique identity, known as the file store
type, in order to differentiate them from each other.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The file store type is defined as a <codeph>TUidType</codeph> which can
be constructed from one, two or three UIDs, i.e. <codeph>TUid</codeph> components.</p>
<p>The first UID component identifies the layout of the file store; i.e. it
identifies the file store as either a direct file store or a permanent file
store. The second and/or the third UID components are application dependent.</p>
<p>After creating a new file store, an application must set the type of the
file store using the file store's <codeph>SetTypeL()</codeph> member function.</p>
<p>As a minimum requirement, the first UID component of the <codeph>TUidType</codeph>,
which identifies the layout of the file store, must be specified. This component
takes one of the values:</p>
<ul>
<li id="GUID-0BFB4EDE-6C99-586F-BEE4-2F85BF338512"><p><codeph>KPermanentFileStoreLayout</codeph> to
identify a permanent file store.</p> </li>
<li id="GUID-32FD6BB3-1D1B-5CC4-BC3C-903655E08E86"><p><codeph>KDirectFileStoreLayout</codeph> to
identify a direct file store.</p> </li>
</ul>
<p>The following code fragment is typical:</p>
<codeblock id="GUID-DA3A8804-C597-522E-8AB4-2D971F3085CB" xml:space="preserve">...
CFileStore* store = CDirectFileStore::ReplaceLC(...,...,...);
store-&gt;SetTypeL(KDirectFileStoreLayoutUid);
...</codeblock>
<p>If an application needs to explicitly set the second or the third UID component,
then the <codeph>TUidType</codeph> object must be constructed explicitly and
passed to <codeph>SetTypeL()</codeph>; for example:</p>
<codeblock id="GUID-0389703A-8AAD-5716-863C-9121B26097DE" xml:space="preserve"> ...
 CFileStore* store = CDirectFileStore::ReplaceLC(...,...,...);
 TUidType thetype(KDirectFileStoreLayoutUid,...,...);
 store-&gt;SetTypeL(thetype);
 ...</codeblock>
<p>The file store's type can be retrieved by calling the file store’s <codeph>Type(</codeph>)
member function.</p>
<p>The file store's layout can be retrieved by calling the file store’s <codeph>Layout()</codeph> member
function.</p>
</conbody><related-links>
<link href="GUID-95DF676F-F9BA-56E0-A4DE-E68B42C06932.dita"><linktext>UID manipulation</linktext>
</link>
</related-links></concept>