driveinfo.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : driveinfo.h
00004 *  Part of     : Common Services / Platform Environment
00005 *  Interface   : SDK, Platform Environment API
00006 *  Description : Interface for quering the drive information of the system.
00007 *  Version     : %version: 6 %
00008 *
00009 *  Copyright © 2007 Nokia. All rights reserved.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia. All rights are reserved. Copying, including 
00013 *  reproducing, storing, adapting or translating, any 
00014 *  or all of this material requires the prior written consent of 
00015 *  Nokia. This material also contains confidential 
00016 *  information which may not be disclosed to others without the 
00017 *  prior written consent of Nokia.
00018 * ==============================================================================
00019 */
00020 
00021 
00022 #ifndef DRIVE_INFO_H
00023 #define DRIVE_INFO_H
00024 
00025 //  INCLUDES
00026 #include <e32std.h>
00027 #include <f32file.h>
00028 
00029 // CLASS DECLARATION
00099 NONSHARABLE_CLASS(DriveInfo)
00100     {
00101     public:
00106         enum TDefaultDrives
00107             {
00110             EDefaultRom = 0,
00111 
00114             EDefaultRam,
00115 
00119             EDefaultSystem,
00120 
00123             EDefaultPhoneMemory,
00124 
00129             EDefaultMassStorage,
00130 
00134             EDefaultRemovableMassStorage
00135             };
00136 
00151         IMPORT_C static TInt GetDefaultDrive( TInt aDefaultDrive, TInt& aDrive );
00152 
00166         IMPORT_C static TInt GetDefaultDrive( TInt aDefaultDrive, TChar& aDriveLetter );
00167 
00172         enum TStatus
00173             {
00177             EDriveInternal = 0x1,
00178 
00181             EDriveRemovable = 0x2,
00182 
00185             EDriveRemote = 0x4,
00186 
00189             EDrivePresent = 0x8,
00190 
00193             EDriveLocked = 0x10,
00194 
00197             EDriveCorrupt = 0x20,
00198 
00202             EDriveInUse = 0x40,
00203 
00206             EDriveReadOnly = 0x80,
00207 
00210             EDriveSubsted = 0x100,
00211 
00215             EDriveUserVisible = 0x200,
00216 
00220             EDriveExternallyMountable = 0x400,
00221 
00225             EDriveSwEjectable = 0x800,
00226 
00229             EDriveRom = 0x1000,
00230 
00233             EDriveRam = 0x2000,
00234 
00237             EDriveFormatted = 0x4000,
00238 
00241             EDriveFormattable = 0x8000,
00242 
00245             EDriveLockable = 0x10000,
00246 
00249             EDriveHasPassword = 0x20000
00250 
00251             };
00252 
00266         IMPORT_C static TInt GetDriveStatus( RFs& aFs, TInt aDrive, TUint& aStatus );
00267 
00280         IMPORT_C static TInt GetUserVisibleDrives(
00281             RFs& aFs, TDriveList& aDriveList, TInt& aDriveCount );
00282 
00299         IMPORT_C static TInt GetUserVisibleDrives(
00300             RFs& aFs, TDriveList& aDriveList, TInt& aDriveCount, TUint aFlags );
00301 
00313         IMPORT_C static TInt StripUserHiddenDrives( TDriveList& aDriveList );
00314 
00324         IMPORT_C static TInt DriveCount( const TDriveList& aDriveList );
00325 
00330         class TDriveArray
00331             {
00332             public: // Constructors
00333                 inline TDriveArray();
00334                 inline TDriveArray( const TDriveList& aDriveList );
00335 
00336             public:
00345                 IMPORT_C void Set( const TDriveList& aDriveList );
00346 
00352                 inline void Reset();
00353 
00360                 inline TInt Count() const;
00361 
00374                 inline TDriveNumber operator[]( TInt aIndex ) const;
00375 
00386                 IMPORT_C TChar LetterAt( TInt aIndex ) const;
00387 
00388             private:
00389                 TBuf8< KMaxDrives > iArray;
00390             };
00391 
00403         IMPORT_C static TInt GetUserVisibleDrives( RFs& aFs, TDriveArray& aDriveArray );
00404 
00420         IMPORT_C static TInt GetUserVisibleDrives(
00421             RFs& aFs, TDriveArray& aDriveArray, TUint aFlags );
00422 
00423     private:
00424 
00428         DriveInfo();
00429     };
00430 
00431 #include "driveinfo.inl"
00432 
00433 #endif      // DRIVE_INFO_H   
00434 
00435 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top