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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user