|
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "UF_STD.H" |
|
17 |
|
18 GLDEF_C void Panic(TFilePanic aPanic) |
|
19 // |
|
20 // Panic the process with STORE-File as the category. |
|
21 // |
|
22 { |
|
23 _LIT(KCategory,"STORE-File"); |
|
24 User::Panic(KCategory,aPanic); |
|
25 } |
|
26 |
|
27 EXPORT_C CFileStore* FileStoreFactory::DirectLC(RFileBuf& aBuf,const TUidType& aType) |
|
28 /** Opens an existing direct file store and creates a file store object to represent |
|
29 it. |
|
30 |
|
31 @param aBuf The stream buffer to be used. |
|
32 @param aType The Uidtype for the store. |
|
33 @return A pointer to the new direct file store object. This is Null, if the |
|
34 specified Uidtype is KNullUid or the first Uid component is not KDirectFileStoreLayoutUid. */ |
|
35 { |
|
36 if ((! aType.IsValid()) || aType[0]!=KDirectFileStoreLayoutUid) |
|
37 return NULL; |
|
38 // |
|
39 CDirectFileStore* store=new(ELeave) CDirectFileStore(aBuf,aType); |
|
40 CleanupStack::PushL(store); |
|
41 store->MarshalL(); |
|
42 return store; |
|
43 } |
|
44 |
|
45 EXPORT_C CFileStore* FileStoreFactory::PermanentLC(RFileBuf& aBuf,const TUidType& aType) |
|
46 /** Opens an existing permanent file store and creates a file store object to represent |
|
47 it. |
|
48 |
|
49 @param aBuf The stream buffer to be used. |
|
50 @param aType The Uidtype for the store. |
|
51 @return A pointer to the new permanent file store object. This is Null, if |
|
52 the specified Uidtype is KNullUid or the first Uid component is not KPermanentFileStoreLayoutUid. */ |
|
53 { |
|
54 if ((! aType.IsValid()) || aType[0]!=KPermanentFileStoreLayoutUid) |
|
55 return NULL; |
|
56 // |
|
57 CPermanentFileStore* store=new(ELeave) CPermanentFileStore(aBuf,aType); |
|
58 CleanupStack::PushL(store); |
|
59 store->MarshalL(); |
|
60 return store; |
|
61 } |
|
62 |