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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Contains declaration for BSUL class to cache drive information
24 #ifndef CCACHEDDRIVEINFO_H
25 #define CCACHEDDRIVEINFO_H
33 Class used to cache F32 drive information.
38 NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase
40 private: // private type declarations
41 // Struct to hold drive and media attributes retrieved from a TDriveInfo.
42 struct TDriveAndMediaAttributes
44 // bit-field of drive attributes
45 TUint32 iDriveAttributes;
46 // bit-field of media attributes
47 TUint32 iMediaAttributes;
48 // Media type of the drive
49 TMediaType iMediaType;
52 public: // public methods
53 IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs);
54 IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs);
55 IMPORT_C ~CCachedDriveInfo();
57 IMPORT_C TBool IsReadOnlyInternalL(const TDesC& aFullName) const;
58 IMPORT_C TBool IsReadOnlyInternalL(TDriveUnit aDrive) const;
59 IMPORT_C TBool IsFlagSetOnDriveL(TDriveUnit aDrive, TUint aFlags) const;
60 IMPORT_C TBool MediaTypeL(TDriveUnit aDrive, TMediaType aTestValue, TMediaType* aActual = NULL) const;
61 IMPORT_C TDriveUnit GetDefaultRemovableMemoryCardDriveL() const;
63 private: // private methods
65 void ConstructL(RFs& aFs);
67 static TDriveUnit PathToDriveUnitL(const TDesC& aFullName);
69 private: // private data
70 // Array containing the cached attributes for every drive.
71 TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives];
75 #endif // #ifndef CCACHEDDRIVEINFO_H