add Unmount()

This commit is contained in:
Chris Danford
2004-03-14 01:56:18 +00:00
parent 9555d508ee
commit 2f0a424f3a
2 changed files with 19 additions and 0 deletions
+18
View File
@@ -38,6 +38,10 @@ public:
{
FDB->AddFile( MountPoint, 0, 0 );
}
void Delete( const CString &MountPoint )
{
FDB->DelFile( MountPoint );
}
};
static RageFileDriverMountpoints *g_Mountpoints = NULL;
@@ -277,6 +281,9 @@ void RageFileManager::Mount( CString Type, CString Root, CString MountPoint )
{
LockMut( *g_Mutex );
// unmount anything that was previously mounted here.
Unmount(MountPoint);
if( MountPoint.size() && MountPoint.Right(1) != "/" )
MountPoint += '/';
ASSERT( Root != "" );
@@ -297,6 +304,17 @@ void RageFileManager::Mount( CString Type, CString Root, CString 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 )
{
LockMut( *g_Mutex );