|
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_NCDFILESTORAGEIMPL_H |
|
20 #define C_NCDFILESTORAGEIMPL_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "ncdfilestorage.h" |
|
25 |
|
26 class RFs; |
|
27 class MNcdStorageOwner; |
|
28 |
|
29 /** |
|
30 * File storage |
|
31 * |
|
32 * Moves, removes and opens files from a storage directory |
|
33 * |
|
34 */ |
|
35 class CNcdFileStorage : public CBase, public MNcdFileStorage |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Creates a new file storage |
|
41 * |
|
42 * @param aUid Storage UID |
|
43 * @param aPath Storage root path |
|
44 * @param aFileSession File session used by the storage |
|
45 */ |
|
46 static CNcdFileStorage* NewL( MNcdStorageOwner& aOwner, const TDesC& aUid, |
|
47 const TDesC& aPath ); |
|
48 |
|
49 |
|
50 /** |
|
51 * Creates a new file storage and leaves it to stack |
|
52 * |
|
53 * @param aUid Storage UID |
|
54 * @param aPath Storage root path |
|
55 * @param aFileSession File session used by the storage |
|
56 */ |
|
57 static CNcdFileStorage* NewLC( MNcdStorageOwner& aOwner, |
|
58 const TDesC& aUid, const TDesC& aPath ); |
|
59 |
|
60 virtual ~CNcdFileStorage(); |
|
61 |
|
62 public: // From MNcdFileStorage |
|
63 |
|
64 /** |
|
65 * @see MNcdFileStorage::AddFileL( const TDesC&, TBool ) |
|
66 */ |
|
67 void AddFileL( const TDesC& aFilepath, TBool aOverwrite ); |
|
68 |
|
69 |
|
70 /** |
|
71 * @see MNcdFileStorage::RemoveFileL() |
|
72 */ |
|
73 void RemoveFileL( const TDesC& aFilename ); |
|
74 |
|
75 |
|
76 /** |
|
77 * @see MNcdFileStorage::OpenFileL() |
|
78 */ |
|
79 RFile OpenFileL( RFs& aFs, const TDesC& aFilename, TUint aFileMode ); |
|
80 |
|
81 |
|
82 /** |
|
83 * @see MNcdFileStorage::Uid() |
|
84 */ |
|
85 const TDesC& Uid() const; |
|
86 |
|
87 private: |
|
88 |
|
89 /** |
|
90 * Constructor |
|
91 * |
|
92 * @param aFileSession |
|
93 */ |
|
94 CNcdFileStorage( MNcdStorageOwner& aOwner ); |
|
95 |
|
96 void ConstructL( const TDesC& aUid, const TDesC& aPath ); |
|
97 |
|
98 private: // data |
|
99 |
|
100 MNcdStorageOwner& iOwner; |
|
101 RBuf iRoot; |
|
102 RBuf iUid; |
|
103 }; |
|
104 |
|
105 |
|
106 #endif // C_NCDFILESTORAGE_H |