1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/bsul/inc/ccacheddriveInfo.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,73 @@
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 "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.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 + @file
1.23 +*/
1.24 +
1.25 +#ifndef CCACHEDDRIVEINFO_H
1.26 +#define CCACHEDDRIVEINFO_H
1.27 +
1.28 +#include <e32def.h>
1.29 +#include <f32file.h>
1.30 +
1.31 +namespace BSUL
1.32 + {
1.33 + /**
1.34 + Class used to cache F32 drive information.
1.35 + @see TDriveInfo
1.36 + @publishedAll
1.37 + @released
1.38 + */
1.39 + NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase
1.40 + {
1.41 + private: // private type declarations
1.42 + // Struct to hold drive and media attributes retrieved from a TDriveInfo.
1.43 + struct TDriveAndMediaAttributes
1.44 + {
1.45 + // bit-field of drive attributes
1.46 + TUint32 iDriveAttributes;
1.47 + // bit-field of media attributes
1.48 + TUint32 iMediaAttributes;
1.49 + // Media type of the drive
1.50 + TMediaType iMediaType;
1.51 + };
1.52 +
1.53 + public: // public methods
1.54 + IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs);
1.55 + IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs);
1.56 + IMPORT_C ~CCachedDriveInfo();
1.57 +
1.58 + IMPORT_C TBool IsReadOnlyInternalL(const TDesC& aFullName) const;
1.59 + IMPORT_C TBool IsReadOnlyInternalL(TDriveUnit aDrive) const;
1.60 + IMPORT_C TBool IsFlagSetOnDriveL(TDriveUnit aDrive, TUint aFlags) const;
1.61 + IMPORT_C TBool MediaTypeL(TDriveUnit aDrive, TMediaType aTestValue, TMediaType* aActual = NULL) const;
1.62 + IMPORT_C TDriveUnit GetDefaultRemovableMemoryCardDriveL() const;
1.63 +
1.64 + private: // private methods
1.65 + CCachedDriveInfo();
1.66 + void ConstructL(RFs& aFs);
1.67 +
1.68 + static TDriveUnit PathToDriveUnitL(const TDesC& aFullName);
1.69 +
1.70 + private: // private data
1.71 + // Array containing the cached attributes for every drive.
1.72 + TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives];
1.73 + };
1.74 + }
1.75 +
1.76 +#endif // #ifndef CCACHEDDRIVEINFO_H