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