userlibandfileserver/fileserver/sfile/sf_utl.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
child 268 345b1ca54e88
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
   611 	{
   611 	{
   612 	return((CFileShare*)(SessionObjectFromHandle(aHandle,FileShares->UniqueID(),aSession)));
   612 	return((CFileShare*)(SessionObjectFromHandle(aHandle,FileShares->UniqueID(),aSession)));
   613 	}
   613 	}
   614 
   614 
   615 
   615 
   616 
   616 //
   617 /**
   617 // Returns ETrue if aDes only contains spaces or is zero length
   618     @return ETrue if aDes only contains spaces or is zero length
   618 //
   619     Note that _all_ UNICODE space characters are treated as usual spaces
       
   620 */
       
   621 static TBool IsSpace(const TDesC& aDes)
   619 static TBool IsSpace(const TDesC& aDes)
   622 	{
   620 	{
   623 
   621 
   624 	TInt len=aDes.Length();
   622 	TInt len=aDes.Length();
   625 	if (len==0)
   623 	if (len==0)
   890 	if (r!=KErrNone)
   888 	if (r!=KErrNone)
   891 		return EFalse;
   889 		return EFalse;
   892 	return powerGood;
   890 	return powerGood;
   893 	}
   891 	}
   894 
   892 
   895 //---------------------------------------------------------------------------------------------------------------------------------
       
   896 /**
       
   897     Decrement mount's lock counter when the mount resource, like a file or directory is opened. 
       
   898     See also: CMountCB::LockStatus()   
       
   899 */
       
   900 void AddResource(CMountCB& aMount)
   893 void AddResource(CMountCB& aMount)
       
   894 //
       
   895 // Decrement resource counters
       
   896 //
   901 	{
   897 	{
   902 	__CHECK_DRIVETHREAD(aMount.Drive().DriveNumber());
   898 	__CHECK_DRIVETHREAD(aMount.Drive().DriveNumber());
   903 	__ASSERT_DEBUG(aMount.LockStatus()<=0,Fault(ERawDiskBadAccessCount2));
   899 	__ASSERT_DEBUG(aMount.LockStatus()<=0,Fault(ERawDiskBadAccessCount2));
   904 	aMount.DecLock();
   900 	aMount.DecLock();
   905 	}
   901 	}
   906 
   902 
   907 /**
       
   908     Increment mount's lock counter when the mount resource, like a file or directory is closed. 
       
   909     See also: CMountCB::LockStatus()   
       
   910 */
       
   911 void RemoveResource(CMountCB& aMount)
   903 void RemoveResource(CMountCB& aMount)
       
   904 //
       
   905 // Increment resource counters
       
   906 //
   912 	{
   907 	{
   913 	__ASSERT_DEBUG(aMount.LockStatus()<0,Fault(ERawDiskBadAccessCount1));
   908 	__ASSERT_DEBUG(aMount.LockStatus()<0,Fault(ERawDiskBadAccessCount1));
   914 	aMount.IncLock();
   909 	aMount.IncLock();
   915 	}
   910 	}
   916 
   911 
   917 
   912 
   918 /**
       
   919     Increment mount's lock counter when the disk access (Format, Raw disk) is opened on the mount
       
   920     See also: CMountCB::LockStatus()   
       
   921 */
       
   922 void AddDiskAccess(CMountCB& aMount)
   913 void AddDiskAccess(CMountCB& aMount)
       
   914 //
       
   915 // Increment resource counters
       
   916 //
   923 	{
   917 	{
   924 	aMount.IncLock();
   918 	aMount.IncLock();
   925 	}
   919 	}
   926 
   920 
   927 /**
       
   928     Decrement mount's lock counter when the disk access (Format, Raw disk) is closed on the mount
       
   929     See also: CMountCB::LockStatus()   
       
   930 */
       
   931 void RemoveDiskAccess(CMountCB& aMount)
   921 void RemoveDiskAccess(CMountCB& aMount)
       
   922 //
       
   923 // Decrement resource counters
       
   924 //
   932 	{
   925 	{
   933 	aMount.DecLock();
   926 	aMount.DecLock();
   934 	}
   927 	}
   935 
   928 
   936 EXPORT_C void AllocBufferL(HBufC*& aBuf,const TDesC& aName)
   929 EXPORT_C void AllocBufferL(HBufC*& aBuf,const TDesC& aName)