|
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 <s32crypt.h> |
|
17 #include "U32STD.H" |
|
18 |
|
19 class TCachePage |
|
20 { |
|
21 public: |
|
22 inline TDblQueLink& Link(); |
|
23 inline void Deque(); |
|
24 inline TBool IsQued() const; |
|
25 inline void Reque(TDblQue<TCachePage>& aQue); |
|
26 private: |
|
27 inline const TDblQueLinkBase& Link() const; |
|
28 public: |
|
29 TDblQueLink iLink; |
|
30 TCachePagePool* iOwner; |
|
31 TPageRef iRef; |
|
32 TPageChange iChange; |
|
33 }; |
|
34 // |
|
35 class StorePagePool |
|
36 { |
|
37 public: |
|
38 static TPageRef ExtendL(RStorePagePool& aPool,const TAny* aPage,TPageReclamation aReclamation,const CPBEncryptionBase* aKey=NULL); |
|
39 static void WriteL(RStorePagePool& aPool,TPageRef aRef,const TAny* aPage,TPageChange aChange,const CPBEncryptionBase* aKey=NULL); |
|
40 static void ReadL(RStorePagePool& aPool,TPageRef aRef,TAny* aPage,const CPBEncryptionBase* aKey=NULL); |
|
41 static void DeleteL(RStorePagePool& aPool,TPageRef aRef,const CPBEncryptionBase* aKey=NULL); |
|
42 private: |
|
43 static void PadL(RWriteStream& aStream,TInt aLength); |
|
44 static void EncryptL(RWriteStream& aStream,const TAny* aPage,const CPBEncryptionBase& aKey); |
|
45 static void EncryptNewL(RWriteStream& aStream,const TAny* aPage,const CPBEncryptionBase& aKey); |
|
46 static void DecryptL(RReadStream& aStream,TAny* aPage,const CPBEncryptionBase& aKey); |
|
47 static void SeekL(MStreamBuf* aBuf,TInt aMark,TPageRef aRef,const CPBEncryptionBase* aKey); |
|
48 }; |
|
49 // |
|
50 enum TPagePanic |
|
51 { |
|
52 EPageNotOpen, |
|
53 EPageChangeInvalid, |
|
54 EPageDoubleLock, |
|
55 EPageNotLocked, |
|
56 EPageCacheInUse, |
|
57 EPageCacheFull, |
|
58 EPageReclaimAvailable, |
|
59 EPageCipherTextOverrun, |
|
60 ECryptKeyUninitialised, |
|
61 EPageBadKeyType |
|
62 }; |
|
63 |
|
64 GLREF_C void Panic(TPagePanic aPanic); |
|
65 |
|
66 #include "UP_STD.INL" |
|
67 |