refactor(Core): replace boost::filesystem with std::filesystem (#6800)

This commit is contained in:
Francesco Borzì
2021-07-09 16:43:51 +02:00
committed by GitHub
parent f79e23e887
commit ebb80145b3
6 changed files with 24 additions and 28 deletions

View File

@@ -25,7 +25,7 @@ EndScriptData */
#include "StringConvert.h"
#include "VMapFactory.h"
#include "VMapManager2.h"
#include <boost/filesystem/operations.hpp>
#include <filesystem>
#include <boost/version.hpp>
#include <openssl/crypto.h>
#include <openssl/opensslv.h>
@@ -154,20 +154,20 @@ public:
for (std::string const& subDir : subDirs)
{
boost::filesystem::path mapPath(dataDir);
std::filesystem::path mapPath(dataDir);
mapPath /= subDir;
if (!boost::filesystem::exists(mapPath))
if (!std::filesystem::exists(mapPath))
{
handler->PSendSysMessage("%s directory doesn't exist!. Using path: %s", subDir.c_str(), mapPath.generic_string().c_str());
continue;
}
auto end = boost::filesystem::directory_iterator();
std::size_t folderSize = std::accumulate(boost::filesystem::directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, boost::filesystem::path const& mapFile)
auto end = std::filesystem::directory_iterator();
std::size_t folderSize = std::accumulate(std::filesystem::directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, std::filesystem::path const& mapFile)
{
if (boost::filesystem::is_regular_file(mapFile))
val += boost::filesystem::file_size(mapFile);
if (std::filesystem::is_regular_file(mapFile))
val += std::filesystem::file_size(mapFile);
return val;
});