|
1 /* |
|
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * CSisRegistryFile - this class provide a link between a subsession id, |
|
16 * registry object and its related stream |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @released |
|
24 @internalComponent |
|
25 */ |
|
26 |
|
27 #ifndef __SISREGISTRYFILE_H__ |
|
28 #define __SISREGISTRYFILE_H__ |
|
29 |
|
30 #include <s32file.h> |
|
31 |
|
32 namespace Swi |
|
33 { |
|
34 class CSisRegistryPackage; |
|
35 class CSisRegistryCache; |
|
36 class CSisRegistryObject; |
|
37 |
|
38 class CSisRegistryFile: public CBase |
|
39 { |
|
40 public: |
|
41 static CSisRegistryFile* NewL(const CSisRegistryPackage& aPackage, CSisRegistryCache& aCache); |
|
42 static CSisRegistryFile* NewLC(const CSisRegistryPackage& aPackage, CSisRegistryCache& aCache); |
|
43 |
|
44 ~CSisRegistryFile(); |
|
45 |
|
46 TUint SubsessionId() const; |
|
47 CSisRegistryObject& RegistryObject() const; |
|
48 |
|
49 // const CSisRegistryPackage& Package() const; |
|
50 |
|
51 private: |
|
52 /** |
|
53 * Reloads the CSisRegistryObject from the specified file. It should be |
|
54 * noted that this deletes the current object which may have been |
|
55 * returned to other clients. In the server this should not happen. |
|
56 **/ |
|
57 void ReloadL(const TFileName& filename, CSisRegistryCache& aCache); |
|
58 |
|
59 void ConstructL(const CSisRegistryPackage& aPackage, CSisRegistryCache& aCache); |
|
60 RFileReadStream& ReadStream() ; |
|
61 |
|
62 |
|
63 private: |
|
64 friend class CSisRegistryCache; |
|
65 |
|
66 TUint iSubsessionId; |
|
67 CSisRegistryObject* iObject; |
|
68 RFileReadStream iFileStream; |
|
69 }; |
|
70 |
|
71 |
|
72 inline RFileReadStream& CSisRegistryFile::ReadStream() |
|
73 { |
|
74 return iFileStream; |
|
75 } |
|
76 |
|
77 inline TUint CSisRegistryFile::SubsessionId() const |
|
78 { |
|
79 return iSubsessionId; |
|
80 } |
|
81 |
|
82 inline CSisRegistryObject& CSisRegistryFile::RegistryObject() const |
|
83 { |
|
84 return *iObject; |
|
85 } |
|
86 |
|
87 |
|
88 } // namespace |
|
89 |
|
90 #endif// __SISREGISTRYFILE_H__ |
|
91 |
|
92 |
|
93 |
|
94 |