|
1 // Copyright (c) 2004-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 #ifndef SRVRES_H |
|
17 #define SRVRES_H |
|
18 |
|
19 #include <f32file.h> |
|
20 #include "srvPerf.h" |
|
21 |
|
22 class CRepositoryCacheManager; |
|
23 |
|
24 |
|
25 class TOwnerIdMapping |
|
26 { |
|
27 public : |
|
28 inline TOwnerIdMapping(); |
|
29 inline TOwnerIdMapping(TUint32 aRepUid, TUint32 aOwner); |
|
30 static TInt CompareUids (const TOwnerIdMapping& aOwnerIdMapping1, const TOwnerIdMapping& aOwnerIdMapping2) ; |
|
31 |
|
32 public: |
|
33 TUint32 iRepUid; |
|
34 TUint32 iOwner; |
|
35 }; |
|
36 |
|
37 const TUint8 KPersistFormatVersion = 1 ; |
|
38 const TUint8 KPersistFormatSupportsDeletedSettings = 1 ; |
|
39 |
|
40 namespace NCentralRepositoryResources |
|
41 { |
|
42 enum TCentRepLocation |
|
43 { |
|
44 EPersists, |
|
45 EInstall, |
|
46 ERom |
|
47 }; |
|
48 |
|
49 enum TCentRepFileType |
|
50 { |
|
51 ECre, |
|
52 EIni, |
|
53 ETmp, |
|
54 EUnknown |
|
55 }; |
|
56 } |
|
57 |
|
58 using namespace NCentralRepositoryResources; |
|
59 |
|
60 class TServerResources |
|
61 { |
|
62 public: |
|
63 static void InitialiseL(); |
|
64 static void Close(); |
|
65 static TInt GetUid(TEntry& aEntry, TUid& aUid); |
|
66 static TBool PersistFileExistsL(TUid aUid); |
|
67 inline static TInt AddOwnerIdLookupMapping(const TUint32 aRepositoryUid, const TUint32 aOwnerUid) ; |
|
68 inline static TInt FindOwnerIdLookupMapping(TUint32 aRepositoryId) ; |
|
69 static void CreateRepositoryFileNameLC(HBufC*& aFullFileName, |
|
70 TUid aUid, |
|
71 TCentRepLocation aLocation, |
|
72 TCentRepFileType aFileType); |
|
73 |
|
74 static TBool CentrepFileExistsL(TUid aUid, TCentRepLocation aLocation, TCentRepFileType aType); |
|
75 static TBool CentrepFileExistsL(TUid aUid, TCentRepLocation aLocation); |
|
76 static TTime CentrepFileTimeStampL(TUid aUid, TCentRepLocation aLocation); |
|
77 static TBool RomFileExistsL(TUid aUid); |
|
78 static TBool InstallFileExistsL(TUid aUid); |
|
79 static TBool PersistsFileExistsL(TUid aUid); |
|
80 static void DeletePersistsFileL(TUid aUid); |
|
81 public: |
|
82 static RFs iFs; |
|
83 |
|
84 static HBufC* iRomDirectory; |
|
85 static HBufC* iDataDirectory; |
|
86 static HBufC* iInstallDirectory; |
|
87 static HBufC* iBURDirectory; |
|
88 static HBufC* iIniExt; |
|
89 static HBufC* iCreExt; |
|
90 static HBufC* iTrnsExt; |
|
91 static TUint8 iPersistsVersion; |
|
92 |
|
93 static RArray<TOwnerIdMapping> iOwnerIdLookUpTable; |
|
94 |
|
95 static CRepositoryCacheManager* iCacheManager; |
|
96 static TInt nPushed; |
|
97 #ifdef __CENTREP_SERVER_MEMTEST__ |
|
98 static void RecordTimerResult(TMemTestLocationIdentifier aLocation, TInt32 aIdentifier); |
|
99 static void StopRecordTimerResult(); |
|
100 |
|
101 static TInt32 iMemTestData[KMemBufMaxEntry]; |
|
102 static TInt32 iMemTestDataCount; |
|
103 #endif |
|
104 }; |
|
105 |
|
106 |
|
107 #include "srvres.inl" |
|
108 |
|
109 #endif // SRVRES_H |