diff --git a/src/common/Utilities/StartProcess.cpp b/src/common/Utilities/StartProcess.cpp index 132be879e..53c25bf38 100644 --- a/src/common/Utilities/StartProcess.cpp +++ b/src/common/Utilities/StartProcess.cpp @@ -8,6 +8,7 @@ #include "Log.h" #include "Optional.h" #include "Util.h" +#include #include #include #include @@ -82,7 +83,7 @@ namespace Acore { // With binding stdin return child{ - exe = boost::filesystem::absolute(executable).string(), + exe = std::filesystem::absolute(executable).string(), args = argsVector, env = environment(boost::this_process::environment()), std_in = inputFile.get(), @@ -94,7 +95,7 @@ namespace Acore { // Without binding stdin return child{ - exe = boost::filesystem::absolute(executable).string(), + exe = std::filesystem::absolute(executable).string(), args = argsVector, env = environment(boost::this_process::environment()), std_in = boost::process::close, diff --git a/src/server/database/Updater/DBUpdater.cpp b/src/server/database/Updater/DBUpdater.cpp index c8995249c..ab657ec10 100644 --- a/src/server/database/Updater/DBUpdater.cpp +++ b/src/server/database/Updater/DBUpdater.cpp @@ -13,7 +13,7 @@ #include "QueryResult.h" #include "StartProcess.h" #include "UpdateFetcher.h" -#include +#include #include #include @@ -27,7 +27,7 @@ std::string DBUpdaterUtil::GetCorrectedMySQLExecutable() bool DBUpdaterUtil::CheckExecutable() { - boost::filesystem::path exe(GetCorrectedMySQLExecutable()); + std::filesystem::path exe(GetCorrectedMySQLExecutable()); if (!is_regular_file(exe)) { exe = Acore::SearchExecutableInPath("mysql"); @@ -191,13 +191,13 @@ bool DBUpdater::Create(DatabaseWorkerPool& pool) catch (UpdateException&) { LOG_FATAL("sql.updates", "Failed to create database %s! Does the user (named in *.conf) have `CREATE`, `ALTER`, `DROP`, `INSERT` and `DELETE` privileges on the MySQL server?", pool.GetConnectionInfo()->database.c_str()); - boost::filesystem::remove(temp); + std::filesystem::remove(temp); return false; } LOG_INFO("sql.updates", "Done."); LOG_INFO("sql.updates", " "); - boost::filesystem::remove(temp); + std::filesystem::remove(temp); return true; } @@ -294,7 +294,7 @@ bool DBUpdater::Populate(DatabaseWorkerPool& pool) std::string const DirPathStr = DBUpdater::GetBaseFilesDirectory(); Path const DirPath(DirPathStr); - if (!boost::filesystem::is_directory(DirPath)) + if (!std::filesystem::is_directory(DirPath)) { LOG_ERROR("sql.updates", ">> Directory \"%s\" not exist", DirPath.generic_string().c_str()); return false; @@ -306,10 +306,10 @@ bool DBUpdater::Populate(DatabaseWorkerPool& pool) return false; } - boost::filesystem::directory_iterator const DirItr; + std::filesystem::directory_iterator const DirItr; uint32 FilesCount = 0; - for (boost::filesystem::directory_iterator itr(DirPath); itr != DirItr; ++itr) + for (std::filesystem::directory_iterator itr(DirPath); itr != DirItr; ++itr) { if (itr->path().extension() == ".sql") FilesCount++; @@ -321,7 +321,7 @@ bool DBUpdater::Populate(DatabaseWorkerPool& pool) return false; } - for (boost::filesystem::directory_iterator itr(DirPath); itr != DirItr; ++itr) + for (std::filesystem::directory_iterator itr(DirPath); itr != DirItr; ++itr) { if (itr->path().extension() != ".sql") continue; diff --git a/src/server/database/Updater/DBUpdater.h b/src/server/database/Updater/DBUpdater.h index f7f05076b..04a819e7c 100644 --- a/src/server/database/Updater/DBUpdater.h +++ b/src/server/database/Updater/DBUpdater.h @@ -9,6 +9,7 @@ #include "DatabaseEnv.h" #include "Define.h" #include +#include template class DatabaseWorkerPool; @@ -54,7 +55,7 @@ template class AC_DATABASE_API DBUpdater { public: - using Path = boost::filesystem::path; + using Path = std::filesystem::path; static inline std::string GetConfigEntry(); static inline std::string GetTableName(); diff --git a/src/server/database/Updater/UpdateFetcher.cpp b/src/server/database/Updater/UpdateFetcher.cpp index 0782677e6..25c9c1393 100644 --- a/src/server/database/Updater/UpdateFetcher.cpp +++ b/src/server/database/Updater/UpdateFetcher.cpp @@ -4,7 +4,6 @@ */ #include "UpdateFetcher.h" -#include "Common.h" #include "CryptoHash.h" #include "DBUpdater.h" #include "Field.h" @@ -12,11 +11,10 @@ #include "QueryResult.h" #include "Tokenize.h" #include "Util.h" -#include -#include #include +#include -using namespace boost::filesystem; +using namespace std::filesystem; struct UpdateFetcher::DirectoryEntry { diff --git a/src/server/database/Updater/UpdateFetcher.h b/src/server/database/Updater/UpdateFetcher.h index 665adaf07..6a07cee4e 100644 --- a/src/server/database/Updater/UpdateFetcher.h +++ b/src/server/database/Updater/UpdateFetcher.h @@ -12,11 +12,7 @@ #include #include #include - -namespace boost::filesystem -{ - class path; -} +#include struct AC_DATABASE_API UpdateResult { @@ -33,7 +29,7 @@ struct AC_DATABASE_API UpdateResult class AC_DATABASE_API UpdateFetcher { - typedef boost::filesystem::path Path; + typedef std::filesystem::path Path; public: UpdateFetcher(Path const& updateDirectory, diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 19671938c..9a31c92ad 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -25,7 +25,7 @@ EndScriptData */ #include "StringConvert.h" #include "VMapFactory.h" #include "VMapManager2.h" -#include +#include #include #include #include @@ -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; });