|
1 // Copyright (c) 2007-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 // Contains declaration for BSUL class to cache drive information |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 #ifndef CCACHEDDRIVEINFO_H |
|
23 #define CCACHEDDRIVEINFO_H |
|
24 |
|
25 #include <e32def.h> |
|
26 #include <f32file.h> |
|
27 |
|
28 namespace BSUL |
|
29 { |
|
30 /** |
|
31 Class used to cache F32 drive information. |
|
32 @see TDriveInfo |
|
33 @publishedAll |
|
34 @released |
|
35 */ |
|
36 NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase |
|
37 { |
|
38 private: // private type declarations |
|
39 // Struct to hold drive and media attributes retrieved from a TDriveInfo. |
|
40 struct TDriveAndMediaAttributes |
|
41 { |
|
42 // bit-field of drive attributes |
|
43 TUint32 iDriveAttributes; |
|
44 // bit-field of media attributes |
|
45 TUint32 iMediaAttributes; |
|
46 // Media type of the drive |
|
47 TMediaType iMediaType; |
|
48 }; |
|
49 |
|
50 public: // public methods |
|
51 IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs); |
|
52 IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs); |
|
53 IMPORT_C ~CCachedDriveInfo(); |
|
54 |
|
55 IMPORT_C TBool IsReadOnlyInternalL(const TDesC& aFullName) const; |
|
56 IMPORT_C TBool IsReadOnlyInternalL(TDriveUnit aDrive) const; |
|
57 IMPORT_C TBool IsFlagSetOnDriveL(TDriveUnit aDrive, TUint aFlags) const; |
|
58 IMPORT_C TBool MediaTypeL(TDriveUnit aDrive, TMediaType aTestValue, TMediaType* aActual = NULL) const; |
|
59 IMPORT_C TDriveUnit GetDefaultRemovableMemoryCardDriveL() const; |
|
60 |
|
61 private: // private methods |
|
62 CCachedDriveInfo(); |
|
63 void ConstructL(RFs& aFs); |
|
64 |
|
65 static TDriveUnit PathToDriveUnitL(const TDesC& aFullName); |
|
66 |
|
67 private: // private data |
|
68 // Array containing the cached attributes for every drive. |
|
69 TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives]; |
|
70 }; |
|
71 } |
|
72 |
|
73 #endif // #ifndef CCACHEDDRIVEINFO_H |