|
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 #include "srvdefs.h" |
|
22 |
|
23 class CRepositoryCacheManager; |
|
24 class CObservable; |
|
25 |
|
26 class TOwnerIdMapping |
|
27 { |
|
28 public : |
|
29 inline TOwnerIdMapping(); |
|
30 inline TOwnerIdMapping(TUint32 aRepUid, TUint32 aOwner); |
|
31 static TInt CompareUids (const TOwnerIdMapping& aOwnerIdMapping1, const TOwnerIdMapping& aOwnerIdMapping2) ; |
|
32 |
|
33 public: |
|
34 TUint32 iRepUid; |
|
35 TUint32 iOwner; |
|
36 }; |
|
37 |
|
38 |
|
39 |
|
40 using namespace NCentralRepositoryResources; |
|
41 |
|
42 class TServerResources |
|
43 { |
|
44 public: |
|
45 static void InitialiseL(); |
|
46 static void Close(); |
|
47 static TInt GetUid(TEntry& aEntry, TUid& aUid); |
|
48 inline static TInt AddOwnerIdLookupMapping(const TUint32 aRepositoryUid, const TUint32 aOwnerUid) ; |
|
49 inline static TInt FindOwnerIdLookupMapping(TUint32 aRepositoryId) ; |
|
50 static void CreateRepositoryFileNameLC(HBufC*& aFullFileName, |
|
51 TUid aUid, |
|
52 TCentRepLocation aLocation, |
|
53 TCentRepFileType aFileType); |
|
54 static void CreateRepositoryFileNameL(HBufC*& aFullFileName, |
|
55 TUid aUid, |
|
56 TCentRepLocation aLocation, |
|
57 TCentRepFileType aFileType); |
|
58 |
|
59 static TBool CentrepFileExistsL(TUid aUid, TCentRepLocation aLocation, TCentRepFileType aType); |
|
60 static TBool CentrepFileExistsL(TUid aUid, TCentRepLocation aLocation); |
|
61 static TTime CentrepFileTimeStampL(TUid aUid, TCentRepLocation aLocation); |
|
62 static TBool RomFileExistsL(TUid aUid); |
|
63 static TBool InstallFileExistsL(TUid aUid); |
|
64 static TBool PersistsFileExistsL(TUid aUid); |
|
65 #ifdef SYMBIAN_BAFL_SYSUTIL |
|
66 static TInt GetTextFromFile(const TDesC& aFilename,TDes8& aValue); |
|
67 #endif |
|
68 static void DeleteCentrepFileL(TUid aUid, TCentRepLocation aLocation, TCentRepFileType aType); |
|
69 public: |
|
70 static RFs iFs; |
|
71 |
|
72 static HBufC* iRomDirectory; |
|
73 static HBufC* iDataDirectory; |
|
74 static HBufC* iInstallDirectory; |
|
75 static HBufC* iBURDirectory; |
|
76 static HBufC* iIniExt; |
|
77 static HBufC* iCreExt; |
|
78 static HBufC* iTrnsExt; |
|
79 static TUint8 iPersistsVersion; |
|
80 |
|
81 static RArray<TOwnerIdMapping> iOwnerIdLookUpTable; |
|
82 |
|
83 static CRepositoryCacheManager* iCacheManager; |
|
84 static CObservable* iObserver; |
|
85 #ifdef __CENTREP_SERVER_PERFTEST__ |
|
86 static TCentRepPerfTest iPerfTestMgr; |
|
87 #endif |
|
88 #ifdef __CENTREP_SERVER_MEMTEST__ |
|
89 static void RecordTimerResult(TMemTestLocationIdentifier aLocation, TInt32 aIdentifier); |
|
90 static void StopRecordTimerResult(); |
|
91 static void StartRecordTimerResult(); |
|
92 |
|
93 static TInt32 iMemTestData[KMemBufMaxEntry]; |
|
94 static TInt32 iMemTestDataCount; |
|
95 #endif |
|
96 }; |
|
97 |
|
98 |
|
99 #include "srvres.inl" |
|
100 |
|
101 #endif // SRVRES_H |