add RageFileManager::Remove

This commit is contained in:
Glenn Maynard
2003-12-16 07:23:54 +00:00
parent b2f375f4ec
commit d5abb2b0c8
5 changed files with 79 additions and 2 deletions
+19 -1
View File
@@ -153,7 +153,7 @@ CString LoadedDriver::GetPath( CString path )
bool ilt( const CString &a, const CString &b ) { return a.CompareNoCase(b) < 0; }
bool ieq( const CString &a, const CString &b ) { return a.CompareNoCase(b) == 0; }
void RageFileManager::GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo )
void RageFileManager::GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo )
{
for( unsigned i = 0; i < g_Drivers.size(); ++i )
{
@@ -179,6 +179,24 @@ void RageFileManager::GetDirListing( CString sPath, CStringArray &AddTo, bool bO
AddTo.erase(it, AddTo.end());
}
bool RageFileManager::Remove( const CString &sPath )
{
/* Multiple drivers may have the same file. */
bool Deleted = false;
for( unsigned i = 0; i < g_Drivers.size(); ++i )
{
const CString p = g_Drivers[i].GetPath( sPath );
if( p.size() == 0 )
continue;
bool ret = g_Drivers[i].driver->Remove( p );
if( !ret )
Deleted = true;
}
return Deleted;
}
#include "RageFileDriverDirect.h"
#include "RageFileDriverZip.h"
void RageFileManager::Mount( CString Type, CString Root, CString MountPoint )