First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Contains declaration for BSUL class to cache drive information
22 #ifndef CCACHEDDRIVEINFO_H
23 #define CCACHEDDRIVEINFO_H
31 Class used to cache F32 drive information.
36 NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase
38 private: // private type declarations
39 // Struct to hold drive and media attributes retrieved from a TDriveInfo.
40 struct TDriveAndMediaAttributes
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;
50 public: // public methods
51 IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs);
52 IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs);
53 IMPORT_C ~CCachedDriveInfo();
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;
61 private: // private methods
63 void ConstructL(RFs& aFs);
65 static TDriveUnit PathToDriveUnitL(const TDesC& aFullName);
67 private: // private data
68 // Array containing the cached attributes for every drive.
69 TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives];
73 #endif // #ifndef CCACHEDDRIVEINFO_H