Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
<?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 xml:lang="en" id="GUID-A9EA16CE-2F80-5344-827D-0C2ED5812788"><title>File store type and layout</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>File stores can be given a unique identity, known as the file store type, in order to differentiate them from each other.</p> <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->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->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> <section><title>See also</title> <p><xref href="GUID-95DF676F-F9BA-56E0-A4DE-E68B42C06932.dita">UID manipulation</xref> </p> </section> </conbody></concept>