epoc32/include/bsul/ccacheddriveinfo.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/bsul/ccacheddriveinfo.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,75 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// 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
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Contains declaration for BSUL class to cache drive information
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file
    1.25 +*/
    1.26 +
    1.27 +#ifndef CCACHEDDRIVEINFO_H
    1.28 +#define CCACHEDDRIVEINFO_H
    1.29 +
    1.30 +#include <e32def.h>
    1.31 +#include <f32file.h>
    1.32 +
    1.33 +namespace BSUL
    1.34 +	{
    1.35 +	/**
    1.36 +	 Class used to cache F32 drive information.
    1.37 +	 @see TDriveInfo
    1.38 +	 @publishedAll
    1.39 +	 @released
    1.40 +	 */
    1.41 +	NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase
    1.42 +		{
    1.43 +	private: // private type declarations
    1.44 +		// Struct to hold drive and media attributes retrieved from a TDriveInfo.
    1.45 +		struct TDriveAndMediaAttributes
    1.46 +			{
    1.47 +			// bit-field of drive attributes
    1.48 +			TUint32 iDriveAttributes;
    1.49 +			// bit-field of media attributes
    1.50 +			TUint32 iMediaAttributes;
    1.51 +			// Media type of the drive
    1.52 +			TMediaType iMediaType;
    1.53 +			};
    1.54 +		
    1.55 +	public: // public methods
    1.56 +		IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs);
    1.57 +		IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs);
    1.58 +		IMPORT_C ~CCachedDriveInfo();
    1.59 +		
    1.60 +		IMPORT_C TBool IsReadOnlyInternalL(const TDesC& aFullName) const;
    1.61 +		IMPORT_C TBool IsReadOnlyInternalL(TDriveUnit aDrive) const;
    1.62 +		IMPORT_C TBool IsFlagSetOnDriveL(TDriveUnit aDrive, TUint aFlags) const;
    1.63 +		IMPORT_C TBool MediaTypeL(TDriveUnit aDrive, TMediaType aTestValue, TMediaType* aActual = NULL) const;
    1.64 +		IMPORT_C TDriveUnit GetDefaultRemovableMemoryCardDriveL() const;
    1.65 +		
    1.66 +	private: // private methods
    1.67 +		CCachedDriveInfo();
    1.68 +		void ConstructL(RFs& aFs);
    1.69 +		
    1.70 +		static TDriveUnit PathToDriveUnitL(const TDesC& aFullName);
    1.71 +		
    1.72 +	private: // private data
    1.73 +		// Array containing the cached attributes for every drive. 
    1.74 +		TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives];
    1.75 +		};
    1.76 +	}
    1.77 +
    1.78 +#endif // #ifndef CCACHEDDRIVEINFO_H