sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Contains declaration for BSUL class to cache drive information sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: */ sl@0: sl@0: #ifndef CCACHEDDRIVEINFO_H sl@0: #define CCACHEDDRIVEINFO_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: namespace BSUL sl@0: { sl@0: /** sl@0: Class used to cache F32 drive information. sl@0: @see TDriveInfo sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase sl@0: { sl@0: private: // private type declarations sl@0: // Struct to hold drive and media attributes retrieved from a TDriveInfo. sl@0: struct TDriveAndMediaAttributes sl@0: { sl@0: // bit-field of drive attributes sl@0: TUint32 iDriveAttributes; sl@0: // bit-field of media attributes sl@0: TUint32 iMediaAttributes; sl@0: // Media type of the drive sl@0: TMediaType iMediaType; sl@0: }; sl@0: sl@0: public: // public methods sl@0: IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs); sl@0: IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs); sl@0: IMPORT_C ~CCachedDriveInfo(); sl@0: sl@0: IMPORT_C TBool IsReadOnlyInternalL(const TDesC& aFullName) const; sl@0: IMPORT_C TBool IsReadOnlyInternalL(TDriveUnit aDrive) const; sl@0: IMPORT_C TBool IsFlagSetOnDriveL(TDriveUnit aDrive, TUint aFlags) const; sl@0: IMPORT_C TBool MediaTypeL(TDriveUnit aDrive, TMediaType aTestValue, TMediaType* aActual = NULL) const; sl@0: IMPORT_C TDriveUnit GetDefaultRemovableMemoryCardDriveL() const; sl@0: sl@0: private: // private methods sl@0: CCachedDriveInfo(); sl@0: void ConstructL(RFs& aFs); sl@0: sl@0: static TDriveUnit PathToDriveUnitL(const TDesC& aFullName); sl@0: sl@0: private: // private data sl@0: // Array containing the cached attributes for every drive. sl@0: TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives]; sl@0: }; sl@0: } sl@0: sl@0: #endif // #ifndef CCACHEDDRIVEINFO_H