|
1 /* |
|
2 * Copyright (c) 2006 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 "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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_NCDSTORAGE_H |
|
20 #define C_NCDSTORAGE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "ncdstorage.h" |
|
25 #include "ncdstorageowner.h" |
|
26 |
|
27 class CNcdDbStorageManager; |
|
28 class CNcdFileStorage; |
|
29 |
|
30 /** |
|
31 * ?one_line_short_description |
|
32 * |
|
33 * ?more_complete_description |
|
34 * |
|
35 * @lib ?library |
|
36 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
37 */ |
|
38 class CNcdStorage : public CBase, |
|
39 public MNcdStorage |
|
40 { |
|
41 public: |
|
42 |
|
43 static CNcdStorage* NewL( MNcdStorageOwner& aOwner, |
|
44 const TDesC& aNamespace ); |
|
45 |
|
46 static CNcdStorage* NewLC( MNcdStorageOwner& aOwner, |
|
47 const TDesC& aNamespace ); |
|
48 |
|
49 static CNcdStorage* NewL( MNcdStorageOwner& aOwner, |
|
50 HBufC* aNamespace, HBufC* aDirectory ); |
|
51 |
|
52 |
|
53 virtual ~CNcdStorage(); |
|
54 |
|
55 public: // MNcdStorage |
|
56 |
|
57 /** |
|
58 * @see MNcdStorage::DatabaseStorageL() |
|
59 */ |
|
60 MNcdDatabaseStorage& DatabaseStorageL( const TDesC& aUid ); |
|
61 |
|
62 |
|
63 /** |
|
64 * @see MNcdStorage::FileStorageL() |
|
65 */ |
|
66 MNcdFileStorage& FileStorageL( const TDesC& aUid ); |
|
67 |
|
68 |
|
69 /** |
|
70 * @see MNcdStorage::Namespace() |
|
71 */ |
|
72 const TDesC& Namespace() const; |
|
73 |
|
74 |
|
75 /** |
|
76 * @see MNcdStorage::Directory() |
|
77 */ |
|
78 const TDesC& Directory() const; |
|
79 |
|
80 |
|
81 /** |
|
82 * @see MNcdStorage::FileSession() |
|
83 */ |
|
84 RFs& FileSession(); |
|
85 |
|
86 |
|
87 /** |
|
88 * @see MNcdStorage::SizeL() |
|
89 */ |
|
90 TInt SizeL(); |
|
91 |
|
92 private: |
|
93 |
|
94 CNcdStorage( MNcdStorageOwner& aOwner ); |
|
95 |
|
96 void ConstructL( const TDesC& aNamespace ); |
|
97 |
|
98 void ConstructL( HBufC* aNamespace, HBufC* aDirectory ); |
|
99 |
|
100 |
|
101 TInt FindDbStorageByUid( const TDesC& aUid ); |
|
102 |
|
103 TInt FindFileStorageByUid( const TDesC& aUid ); |
|
104 |
|
105 // Put current path + aUid to aPath and ensures that |
|
106 // the path exists on drive |
|
107 void CreateCurrentPathL( TDes& aPath, const TDesC& aUid ) const; |
|
108 |
|
109 |
|
110 HBufC* CurrentPathLC() const; |
|
111 |
|
112 private: // data |
|
113 |
|
114 MNcdStorageOwner& iOwner; |
|
115 RBuf iNamespace; |
|
116 RBuf iDirectory; |
|
117 RPointerArray<CNcdDbStorageManager> iDbStorages; |
|
118 RPointerArray<CNcdFileStorage> iFileStorages; |
|
119 }; |
|
120 |
|
121 |
|
122 |
|
123 #endif // C_NCDSTORAGE_H |