mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
second part of c++11 update. gcc 4.5 and VS 2010 are no longer supported
- BOOST_FOREACH -> for - replaced several boost classes with std (e.g. unordered) - removed gcc-4.5 workarounds - ran clang c++11 migration tool to detect some cases: - - pointer initialized with "0" to nullptr - - replace for with iterators with range-based for - - use auto in some situations (type name specified twice, avoid long iterators type names)
This commit is contained in:
@@ -18,9 +18,9 @@ std::unique_ptr<CInputStream> CFilesystemLoader::load(const std::string & resour
|
||||
|
||||
bool CFilesystemLoader::existsEntry(const std::string & resourceName) const
|
||||
{
|
||||
for(auto it = fileList.begin(); it != fileList.end(); ++it)
|
||||
for(auto & elem : fileList)
|
||||
{
|
||||
if(it->second == resourceName)
|
||||
if(elem.second == resourceName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ bool CFilesystemLoader::existsEntry(const std::string & resourceName) const
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::unordered_map<ResourceID, std::string> CFilesystemLoader::getEntries() const
|
||||
std::unordered_map<ResourceID, std::string> CFilesystemLoader::getEntries() const
|
||||
{
|
||||
return fileList;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ bool CFilesystemLoader::createEntry(std::string filename, bool update)
|
||||
}
|
||||
|
||||
|
||||
boost::unordered_map<ResourceID, std::string> CFilesystemLoader::listFiles(size_t depth, bool initial) const
|
||||
std::unordered_map<ResourceID, std::string> CFilesystemLoader::listFiles(size_t depth, bool initial) const
|
||||
{
|
||||
std::set<EResType::Type> initialTypes;
|
||||
initialTypes.insert(EResType::DIRECTORY);
|
||||
@@ -62,7 +62,7 @@ boost::unordered_map<ResourceID, std::string> CFilesystemLoader::listFiles(size_
|
||||
initialTypes.insert(EResType::ARCHIVE_SND);
|
||||
|
||||
assert(boost::filesystem::is_directory(baseDirectory));
|
||||
boost::unordered_map<ResourceID, std::string> fileList;
|
||||
std::unordered_map<ResourceID, std::string> fileList;
|
||||
|
||||
std::vector<std::string> path;//vector holding relative path to our file
|
||||
|
||||
@@ -97,4 +97,4 @@ boost::unordered_map<ResourceID, std::string> CFilesystemLoader::listFiles(size_
|
||||
}
|
||||
|
||||
return fileList;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user