00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef DRIVE_INFO_H
00023 #define DRIVE_INFO_H
00024
00025
00026 #include <e32std.h>
00027 #include <f32file.h>
00028
00029
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:
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