This commit is contained in:
shenweip
2013-11-24 16:08:05 +08:00
committed by Henrik Rydgård
parent 4c6005545b
commit 7832cebacd
6 changed files with 34 additions and 18 deletions

View File

@@ -255,6 +255,19 @@ void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system)
fileSystems.erase(std::remove(fileSystems.begin(), fileSystems.end(), x), fileSystems.end());
}
void MetaFileSystem::Remount(std::string prefix, IFileSystem *oldSystem, IFileSystem *newSystem) {
Unmount(prefix, oldSystem);
Mount(prefix, newSystem);
}
IFileSystem *MetaFileSystem::GetSystem(const std::string &prefix) {
for (auto it = fileSystems.begin(); it != fileSystems.end(); ++it) {
if (it->prefix == prefix)
return it->system;
}
return NULL;
}
void MetaFileSystem::Shutdown()
{
lock_guard guard(lock);