add Unmount()
This commit is contained in:
@@ -38,6 +38,10 @@ public:
|
|||||||
{
|
{
|
||||||
FDB->AddFile( MountPoint, 0, 0 );
|
FDB->AddFile( MountPoint, 0, 0 );
|
||||||
}
|
}
|
||||||
|
void Delete( const CString &MountPoint )
|
||||||
|
{
|
||||||
|
FDB->DelFile( MountPoint );
|
||||||
|
}
|
||||||
};
|
};
|
||||||
static RageFileDriverMountpoints *g_Mountpoints = NULL;
|
static RageFileDriverMountpoints *g_Mountpoints = NULL;
|
||||||
|
|
||||||
@@ -277,6 +281,9 @@ void RageFileManager::Mount( CString Type, CString Root, CString MountPoint )
|
|||||||
{
|
{
|
||||||
LockMut( *g_Mutex );
|
LockMut( *g_Mutex );
|
||||||
|
|
||||||
|
// unmount anything that was previously mounted here.
|
||||||
|
Unmount(MountPoint);
|
||||||
|
|
||||||
if( MountPoint.size() && MountPoint.Right(1) != "/" )
|
if( MountPoint.size() && MountPoint.Right(1) != "/" )
|
||||||
MountPoint += '/';
|
MountPoint += '/';
|
||||||
ASSERT( Root != "" );
|
ASSERT( Root != "" );
|
||||||
@@ -297,6 +304,17 @@ void RageFileManager::Mount( CString Type, CString Root, CString MountPoint )
|
|||||||
g_Mountpoints->Add( MountPoint );
|
g_Mountpoints->Add( MountPoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RageFileManager::Unmount( CString MountPoint )
|
||||||
|
{
|
||||||
|
LockMut( *g_Mutex );
|
||||||
|
|
||||||
|
for( unsigned i = 0; i < g_Drivers.size(); ++i )
|
||||||
|
if( !g_Drivers[i].MountPoint.CompareNoCase( MountPoint ) )
|
||||||
|
g_Drivers.erase( g_Drivers.begin()+i );
|
||||||
|
|
||||||
|
g_Mountpoints->Delete( MountPoint );
|
||||||
|
}
|
||||||
|
|
||||||
bool RageFileManager::IsMounted( CString MountPoint )
|
bool RageFileManager::IsMounted( CString MountPoint )
|
||||||
{
|
{
|
||||||
LockMut( *g_Mutex );
|
LockMut( *g_Mutex );
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public:
|
|||||||
int GetFileHash( const CString &sPath );
|
int GetFileHash( const CString &sPath );
|
||||||
|
|
||||||
void Mount( CString Type, CString RealPath, CString MountPoint );
|
void Mount( CString Type, CString RealPath, CString MountPoint );
|
||||||
|
void Unmount( CString MountPoint );
|
||||||
bool IsMounted( CString MountPoint );
|
bool IsMounted( CString MountPoint );
|
||||||
bool MountpointIsReady( CString MountPoint );
|
bool MountpointIsReady( CString MountPoint );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user