1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fix issue #2068 - maps list update

This commit is contained in:
Vadim Markovtsev
2016-10-16 22:09:57 +02:00
parent 5506ae036a
commit 89f506658e
9 changed files with 39 additions and 8 deletions

View File

@@ -8,10 +8,10 @@ namespace bfs = boost::filesystem;
CFilesystemLoader::CFilesystemLoader(std::string _mountPoint, bfs::path baseDirectory, size_t depth, bool initial):
baseDirectory(std::move(baseDirectory)),
mountPoint(std::move(_mountPoint)),
mountPoint(std::move(_mountPoint)),
fileList(listFiles(mountPoint, depth, initial))
{
logGlobal->traceStream() << "Filesystem loaded, " << fileList.size() << " files found";
logGlobal->traceStream() << "File system loaded, " << fileList.size() << " files found";
}
std::unique_ptr<CInputStream> CFilesystemLoader::load(const ResourceID & resourceName) const
@@ -38,6 +38,14 @@ boost::optional<boost::filesystem::path> CFilesystemLoader::getResourceName(cons
return baseDirectory / fileList.at(resourceName);
}
void CFilesystemLoader::updateFilteredFiles(std::function<bool(const std::string &)> filter) const
{
if (filter(mountPoint))
{
fileList = listFiles(mountPoint, 1, false);
}
}
std::unordered_set<ResourceID> CFilesystemLoader::getFilteredFiles(std::function<bool(const ResourceID &)> filter) const
{
std::unordered_set<ResourceID> foundID;