kerneltest/f32test/fileutils/src/f32_test_utils.cpp
changeset 175 5af6c74cd793
parent 0 a41df078684a
child 244 a77889bee936
equal deleted inserted replaced
148:31ea0f8e3c99 175:5af6c74cd793
   246 
   246 
   247 _LIT(KFsName_LFFS,  "lffs");
   247 _LIT(KFsName_LFFS,  "lffs");
   248 _LIT(KFsName_Win32, "Win32");
   248 _LIT(KFsName_Win32, "Win32");
   249 _LIT(KFsName_ExFAT, "ExFat");
   249 _LIT(KFsName_ExFAT, "ExFat");
   250 _LIT(KFsName_AutoMonuter, "automounter");
   250 _LIT(KFsName_AutoMonuter, "automounter");
       
   251 _LIT(KFsName_HVFS, "HVFS");
   251 
   252 
   252 /**  @return ETrue if "Automounter" FS is mounted on this drive */
   253 /**  @return ETrue if "Automounter" FS is mounted on this drive */
   253 TBool F32_Test_Utils::Is_Automounter(RFs &aFs, TInt aDrive)
   254 TBool F32_Test_Utils::Is_Automounter(RFs &aFs, TInt aDrive)
   254 {
   255 {
   255 	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
   256 	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
   271 
   272 
   272     return (f.CompareF(KFsName_LFFS) == 0 );
   273     return (f.CompareF(KFsName_LFFS) == 0 );
   273 
   274 
   274 }
   275 }
   275    
   276    
   276 /** @return ETrue if "Win32" FS is mounted on this drive (i.e this is emulator's drive c:) */
   277 /** @return ETrue if "Win32" FS is mounted on this drive (i.e this is emulator's drive C:) */
   277 TBool F32_Test_Utils::Is_Win32(RFs &aFs, TInt aDrive)   
   278 TBool F32_Test_Utils::Is_Win32(RFs &aFs, TInt aDrive)   
   278 {
   279 {
   279 	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
   280 	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
   280     TFSName f;
   281     TFSName f;
   281 	TInt r = aFs.FileSystemName(f, aDrive);
   282 	TInt r = aFs.FileSystemName(f, aDrive);
   282     __ASSERT_ALWAYS((r==KErrNone) && (f.Length()>0), User::Invariant());
   283     __ASSERT_ALWAYS((r==KErrNone) && (f.Length()>0), User::Invariant());
   283 
   284 
   284     return (f.CompareF(KFsName_Win32) == 0 );
   285     return (f.CompareF(KFsName_Win32) == 0 );
       
   286 }
       
   287 
       
   288 /** @return ETrue if "HVFS" is mounted on this drive (i.e PlatSim's drive C:) */
       
   289 TBool F32_Test_Utils::Is_HVFS(RFs &aFs, TInt aDrive)
       
   290 {
       
   291 	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
       
   292     TFSName f;
       
   293 	TInt r = aFs.FileSystemName(f, aDrive);
       
   294     __ASSERT_ALWAYS((r==KErrNone) && (f.Length()>0), User::Invariant());
       
   295 
       
   296     return (f.CompareF(KFsName_HVFS) == 0);
       
   297 }
       
   298 
       
   299 /** @return ETrue if "HVFS" or "Win32" FS is mounted on this drive
       
   300  * 			(i.e drive C: of PlatSim or the emulator) */
       
   301 TBool F32_Test_Utils::Is_SimulatedSystemDrive(RFs &aFs, TInt aDrive)
       
   302 {
       
   303 	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
       
   304     TFSName f;
       
   305 	TInt r = aFs.FileSystemName(f, aDrive);
       
   306     __ASSERT_ALWAYS((r==KErrNone) && (f.Length()>0), User::Invariant());
       
   307 
       
   308     return (f.CompareF(KFsName_HVFS) == 0 || f.CompareF(KFsName_Win32) == 0);
   285 }
   309 }
   286 
   310 
   287 /** @return ETrue if the filesystem if FAT (fat12/16/32) */
   311 /** @return ETrue if the filesystem if FAT (fat12/16/32) */
   288 TBool F32_Test_Utils::Is_Fat(RFs &aFs, TInt aDrive)
   312 TBool F32_Test_Utils::Is_Fat(RFs &aFs, TInt aDrive)
   289 {
   313 {