mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
refactor(Core): replace boost::filesystem with std::filesystem (#6800)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#include "QueryResult.h"
|
||||
#include "StartProcess.h"
|
||||
#include "UpdateFetcher.h"
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
@@ -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<T>::Create(DatabaseWorkerPool<T>& 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<T>::Populate(DatabaseWorkerPool<T>& pool)
|
||||
std::string const DirPathStr = DBUpdater<T>::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<T>::Populate(DatabaseWorkerPool<T>& 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<T>::Populate(DatabaseWorkerPool<T>& 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;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Define.h"
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
template <class T>
|
||||
class DatabaseWorkerPool;
|
||||
@@ -54,7 +55,7 @@ template <class T>
|
||||
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();
|
||||
|
||||
@@ -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 <boost/filesystem/operations.hpp>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
||||
using namespace boost::filesystem;
|
||||
using namespace std::filesystem;
|
||||
|
||||
struct UpdateFetcher::DirectoryEntry
|
||||
{
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace boost::filesystem
|
||||
{
|
||||
class path;
|
||||
}
|
||||
#include <filesystem>
|
||||
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user