From c88d428fb57a193fe974c7d28bb8ff6e381247f9 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 13 Jan 2022 14:33:30 +0100 Subject: [PATCH] sys: std::filesystem -> fs --- include/helpers/plugin_manager.hpp | 5 +++-- include/window.hpp | 2 +- .../content/views/view_pattern_editor.hpp | 2 +- .../include/content/views/view_store.hpp | 2 +- .../content/providers/file_provider.cpp | 2 +- .../builtin/source/content/tools_entries.cpp | 7 +++--- .../source/content/views/view_constants.cpp | 4 ++-- .../source/content/views/view_help.cpp | 2 +- .../content/views/view_pattern_editor.cpp | 5 ++--- .../source/content/views/view_store.cpp | 5 ++--- .../source/content/views/view_yara.cpp | 3 +-- .../include/hex/api/content_registry.hpp | 2 ++ plugins/libimhex/include/hex/helpers/net.hpp | 6 +++-- .../libimhex/include/hex/helpers/paths.hpp | 5 ++++- .../hex/helpers/project_file_handler.hpp | 6 ++--- .../libimhex/source/api/content_registry.cpp | 5 +++-- .../source/helpers/loader_script_handler.cpp | 4 ++-- plugins/libimhex/source/helpers/magic.cpp | 2 +- plugins/libimhex/source/helpers/net.cpp | 4 ++-- plugins/libimhex/source/helpers/paths.cpp | 22 +++++++++---------- .../source/pattern_language/preprocessor.cpp | 4 ++-- source/helpers/plugin_manager.cpp | 9 ++++---- source/init/tasks.cpp | 12 +++++----- source/window/window.cpp | 12 +++++----- 24 files changed, 69 insertions(+), 63 deletions(-) diff --git a/include/helpers/plugin_manager.hpp b/include/helpers/plugin_manager.hpp index 62f3c3e71..c69d78f4e 100644 --- a/include/helpers/plugin_manager.hpp +++ b/include/helpers/plugin_manager.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -53,7 +54,7 @@ namespace hex { public: PluginManager() = delete; - static bool load(const std::string &pluginFolder); + static bool load(const fs::path &pluginFolder); static void unload(); static void reload(); @@ -62,7 +63,7 @@ namespace hex { } private: - static inline std::string s_pluginFolder; + static inline fs::path s_pluginFolder; static inline std::vector s_plugins; }; diff --git a/include/window.hpp b/include/window.hpp index 596bbe4f1..c8dde14e4 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -65,7 +65,7 @@ namespace hex { ImGui::Texture m_bannerTexture = { 0 }; ImGui::Texture m_logoTexture = { 0 }; - std::filesystem::path m_safetyBackupPath; + fs::path m_safetyBackupPath; std::list m_popupsToOpen; std::vector m_pressedKeys; diff --git a/plugins/builtin/include/content/views/view_pattern_editor.hpp b/plugins/builtin/include/content/views/view_pattern_editor.hpp index a2a8be879..327681e8f 100644 --- a/plugins/builtin/include/content/views/view_pattern_editor.hpp +++ b/plugins/builtin/include/content/views/view_pattern_editor.hpp @@ -27,7 +27,7 @@ namespace hex::plugin::builtin { private: pl::PatternLanguage *m_parserRuntime, *m_evaluatorRuntime; - std::vector m_possiblePatternFiles; + std::vector m_possiblePatternFiles; u32 m_selectedPatternFile = 0; bool m_runAutomatically = false; diff --git a/plugins/builtin/include/content/views/view_store.hpp b/plugins/builtin/include/content/views/view_store.hpp index 1a4b93a2f..ccde59d74 100644 --- a/plugins/builtin/include/content/views/view_store.hpp +++ b/plugins/builtin/include/content/views/view_store.hpp @@ -42,7 +42,7 @@ namespace hex::plugin::builtin { Net m_net; std::future> m_apiRequest; std::future> m_download; - std::filesystem::path m_downloadPath; + fs::path m_downloadPath; std::vector m_patterns, m_includes, m_magics, m_constants, m_yara; diff --git a/plugins/builtin/source/content/providers/file_provider.cpp b/plugins/builtin/source/content/providers/file_provider.cpp index 466b3506e..cb1bdf7ee 100644 --- a/plugins/builtin/source/content/providers/file_provider.cpp +++ b/plugins/builtin/source/content/providers/file_provider.cpp @@ -138,7 +138,7 @@ namespace hex::plugin::builtin::prv { } std::string FileProvider::getName() const { - return std::filesystem::path(this->m_path).filename().string(); + return fs::path(this->m_path).filename().string(); } std::vector> FileProvider::getDataInformation() const { diff --git a/plugins/builtin/source/content/tools_entries.cpp b/plugins/builtin/source/content/tools_entries.cpp index 855948a06..e2efc5970 100644 --- a/plugins/builtin/source/content/tools_entries.cpp +++ b/plugins/builtin/source/content/tools_entries.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -506,7 +507,7 @@ namespace hex::plugin::builtin { static hex::Net net; static std::future> uploadProcess; - static std::filesystem::path currFile; + static fs::path currFile; static std::vector links; bool uploading = uploadProcess.valid() && uploadProcess.wait_for(0s) != std::future_status::ready; @@ -899,7 +900,7 @@ namespace hex::plugin::builtin { s32 index = 0; for (auto &file : files) { - if (ImGui::Selectable(std::filesystem::path(file).filename().string().c_str(), index == selectedIndex)) + if (ImGui::Selectable(fs::path(file).filename().string().c_str(), index == selectedIndex)) selectedIndex = index; index++; } @@ -993,7 +994,7 @@ namespace hex::plugin::builtin { File input(file, File::Mode::Read); if (!input.isValid()) { - View::showErrorPopup(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, std::filesystem::path(file).filename().string())); + View::showErrorPopup(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, fs::path(file).filename().string())); return; } diff --git a/plugins/builtin/source/content/views/view_constants.cpp b/plugins/builtin/source/content/views/view_constants.cpp index 34150feca..58d464cc6 100644 --- a/plugins/builtin/source/content/views/view_constants.cpp +++ b/plugins/builtin/source/content/views/view_constants.cpp @@ -26,9 +26,9 @@ namespace hex::plugin::builtin { this->m_filterIndices.clear(); for (auto &path : hex::getPath(ImHexPath::Constants)) { - if (!std::filesystem::exists(path)) continue; + if (!fs::exists(path)) continue; - for (auto &file : std::filesystem::directory_iterator(path)) { + for (auto &file : fs::directory_iterator(path)) { if (!file.is_regular_file()) continue; try { diff --git a/plugins/builtin/source/content/views/view_help.cpp b/plugins/builtin/source/content/views/view_help.cpp index e15c184fb..2134ea0b8 100644 --- a/plugins/builtin/source/content/views/view_help.cpp +++ b/plugins/builtin/source/content/views/view_help.cpp @@ -105,7 +105,7 @@ namespace hex::plugin::builtin { ImGui::TableNextColumn(); for (auto &path : hex::getPath(type)) - ImGui::TextUnformatted(path.c_str()); + ImGui::TextUnformatted(path.string().c_str()); } ImGui::EndTable(); diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index c1dc5505b..062bd7df9 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -16,7 +16,6 @@ namespace hex::plugin::builtin { using namespace hex::literals; - namespace fs = std::filesystem; static const TextEditor::LanguageDefinition& PatternLanguage() { static bool initialized = false; @@ -136,7 +135,7 @@ namespace hex::plugin::builtin { std::error_code errorCode; for (const auto &dir : hex::getPath(ImHexPath::Patterns)) { - for (auto &entry : std::filesystem::directory_iterator(dir, errorCode)) { + for (auto &entry : fs::directory_iterator(dir, errorCode)) { foundCorrectType = false; if (!entry.is_regular_file()) continue; @@ -521,7 +520,7 @@ namespace hex::plugin::builtin { entries.resize(this->m_possiblePatternFiles.size()); for (u32 i = 0; i < entries.size(); i++) { - entries[i] = std::filesystem::path(this->m_possiblePatternFiles[i]).filename().string(); + entries[i] = fs::path(this->m_possiblePatternFiles[i]).filename().string(); } if (ImGui::BeginListBox("##patterns_accept", ImVec2(-FLT_MIN, 0))) { diff --git a/plugins/builtin/source/content/views/view_store.cpp b/plugins/builtin/source/content/views/view_store.cpp index 87d7b4497..b701b418b 100644 --- a/plugins/builtin/source/content/views/view_store.cpp +++ b/plugins/builtin/source/content/views/view_store.cpp @@ -8,20 +8,19 @@ #include #include #include +#include +#include #include #include #include #include #include -#include namespace hex::plugin::builtin { using namespace std::literals::string_literals; using namespace std::literals::chrono_literals; - - namespace fs = std::filesystem; ViewStore::ViewStore() : View("hex.builtin.view.store.name") { this->refresh(); diff --git a/plugins/builtin/source/content/views/view_yara.cpp b/plugins/builtin/source/content/views/view_yara.cpp index f7bcaab2d..050c8f33f 100644 --- a/plugins/builtin/source/content/views/view_yara.cpp +++ b/plugins/builtin/source/content/views/view_yara.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -13,8 +14,6 @@ namespace hex::plugin::builtin { - namespace fs = std::filesystem; - ViewYara::ViewYara() : View("hex.builtin.view.yara.name") { yr_initialize(); diff --git a/plugins/libimhex/include/hex/api/content_registry.hpp b/plugins/libimhex/include/hex/api/content_registry.hpp index 183acd1cc..2aa65c25b 100644 --- a/plugins/libimhex/include/hex/api/content_registry.hpp +++ b/plugins/libimhex/include/hex/api/content_registry.hpp @@ -2,6 +2,8 @@ #include #include +#include + #include #include #include diff --git a/plugins/libimhex/include/hex/helpers/net.hpp b/plugins/libimhex/include/hex/helpers/net.hpp index 991e61618..2b9f56632 100644 --- a/plugins/libimhex/include/hex/helpers/net.hpp +++ b/plugins/libimhex/include/hex/helpers/net.hpp @@ -12,6 +12,8 @@ #include #include +#include + using CURL = void; struct curl_slist; @@ -36,8 +38,8 @@ namespace hex { std::future> getString(const std::string &url, u32 timeout = 2000); std::future> getJson(const std::string &url, u32 timeout = 2000); - std::future> uploadFile(const std::string &url, const std::filesystem::path &filePath, u32 timeout = 2000); - std::future> downloadFile(const std::string &url, const std::filesystem::path &filePath, u32 timeout = 2000); + std::future> uploadFile(const std::string &url, const fs::path &filePath, u32 timeout = 2000); + std::future> downloadFile(const std::string &url, const fs::path &filePath, u32 timeout = 2000); [[nodiscard]] std::string encode(const std::string &input); diff --git a/plugins/libimhex/include/hex/helpers/paths.hpp b/plugins/libimhex/include/hex/helpers/paths.hpp index f0938ea94..dc9895d75 100644 --- a/plugins/libimhex/include/hex/helpers/paths.hpp +++ b/plugins/libimhex/include/hex/helpers/paths.hpp @@ -2,9 +2,12 @@ #include #include +#include namespace hex { + namespace fs = std::filesystem; + enum class ImHexPath { Patterns, PatternsInclude, @@ -19,6 +22,6 @@ namespace hex { std::string getExecutablePath(); - std::vector getPath(ImHexPath path, bool listNonExisting = false); + std::vector getPath(ImHexPath path, bool listNonExisting = false); } \ No newline at end of file diff --git a/plugins/libimhex/include/hex/helpers/project_file_handler.hpp b/plugins/libimhex/include/hex/helpers/project_file_handler.hpp index d7cd44414..dc0b8dc65 100644 --- a/plugins/libimhex/include/hex/helpers/project_file_handler.hpp +++ b/plugins/libimhex/include/hex/helpers/project_file_handler.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include namespace hex { @@ -29,7 +29,7 @@ namespace hex { ProjectFile::s_hasUnsavedChanged = true; if (setWindowTitle) - EventManager::post(std::filesystem::path(getFilePath()).filename().string()); + EventManager::post(fs::path(getFilePath()).filename().string()); } [[nodiscard]] static const std::string& getProjectFilePath() { @@ -48,7 +48,7 @@ namespace hex { static void setFilePath(const std::string &filePath) { ProjectFile::s_filePath = filePath; - EventManager::post(std::filesystem::path(filePath).filename().string()); + EventManager::post(fs::path(filePath).filename().string()); } diff --git a/plugins/libimhex/source/api/content_registry.cpp b/plugins/libimhex/source/api/content_registry.cpp index 1b7d18cb8..1347226e0 100644 --- a/plugins/libimhex/source/api/content_registry.cpp +++ b/plugins/libimhex/source/api/content_registry.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -15,7 +16,7 @@ namespace hex { void ContentRegistry::Settings::load() { bool loaded = false; for (const auto &dir : hex::getPath(ImHexPath::Config)) { - std::ifstream settingsFile(dir + "/settings.json"); + std::ifstream settingsFile(dir / "settings.json"); if (settingsFile.good()) { settingsFile >> getSettingsData(); @@ -30,7 +31,7 @@ namespace hex { void ContentRegistry::Settings::store() { for (const auto &dir : hex::getPath(ImHexPath::Config)) { - std::ofstream settingsFile(dir + "/settings.json", std::ios::trunc); + std::ofstream settingsFile(dir / "settings.json", std::ios::trunc); if (settingsFile.good()) { settingsFile << getSettingsData(); diff --git a/plugins/libimhex/source/helpers/loader_script_handler.cpp b/plugins/libimhex/source/helpers/loader_script_handler.cpp index 2aca63d37..32659a413 100644 --- a/plugins/libimhex/source/helpers/loader_script_handler.cpp +++ b/plugins/libimhex/source/helpers/loader_script_handler.cpp @@ -182,8 +182,8 @@ namespace hex { Py_SetProgramName(Py_DecodeLocale((SharedData::mainArgv)[0], nullptr)); for (const auto &dir : hex::getPath(ImHexPath::Python)) { - if (std::filesystem::exists(std::filesystem::path(dir + "/lib/python" PYTHON_VERSION_MAJOR_MINOR))) { - Py_SetPythonHome(Py_DecodeLocale(dir.c_str(), nullptr)); + if (fs::exists(fs::path(dir / "lib" / "python" PYTHON_VERSION_MAJOR_MINOR))) { + Py_SetPythonHome(Py_DecodeLocale(dir.string().c_str(), nullptr)); break; } } diff --git a/plugins/libimhex/source/helpers/magic.cpp b/plugins/libimhex/source/helpers/magic.cpp index c58290242..57fed605d 100644 --- a/plugins/libimhex/source/helpers/magic.cpp +++ b/plugins/libimhex/source/helpers/magic.cpp @@ -25,7 +25,7 @@ namespace hex::magic { std::error_code error; for (const auto &dir : hex::getPath(ImHexPath::Magic)) { - for (const auto &entry : std::filesystem::directory_iterator(dir, error)) { + for (const auto &entry : fs::directory_iterator(dir, error)) { if (entry.is_regular_file() && ((sourceFiles && entry.path().extension().empty()) || (!sourceFiles && entry.path().extension() == ".mgc"))) magicFiles += entry.path().string() + MAGIC_PATH_SEPARATOR; } diff --git a/plugins/libimhex/source/helpers/net.cpp b/plugins/libimhex/source/helpers/net.cpp index 288258e54..b056e7fea 100644 --- a/plugins/libimhex/source/helpers/net.cpp +++ b/plugins/libimhex/source/helpers/net.cpp @@ -168,7 +168,7 @@ namespace hex { }); } - std::future> Net::uploadFile(const std::string &url, const std::filesystem::path &filePath, u32 timeout) { + std::future> Net::uploadFile(const std::string &url, const fs::path &filePath, u32 timeout) { this->m_transmissionActive.lock(); return std::async(std::launch::async, [=, this] { @@ -211,7 +211,7 @@ namespace hex { }); } - std::future> Net::downloadFile(const std::string &url, const std::filesystem::path &filePath, u32 timeout) { + std::future> Net::downloadFile(const std::string &url, const fs::path &filePath, u32 timeout) { this->m_transmissionActive.lock(); return std::async(std::launch::async, [=, this]{ diff --git a/plugins/libimhex/source/helpers/paths.cpp b/plugins/libimhex/source/helpers/paths.cpp index 08e24385f..ba119306a 100644 --- a/plugins/libimhex/source/helpers/paths.cpp +++ b/plugins/libimhex/source/helpers/paths.cpp @@ -36,14 +36,14 @@ namespace hex { #endif } - std::vector getPath(ImHexPath path, bool listNonExisting) { - std::vector result; + std::vector getPath(ImHexPath path, bool listNonExisting) { + std::vector result; #if defined(OS_WINDOWS) const auto exePath = getExecutablePath(); - const auto parentDir = std::filesystem::path(exePath).parent_path(); + const auto parentDir = fs::path(exePath).parent_path(); - std::filesystem::path appDataDir; + fs::path appDataDir; { LPWSTR wAppDataPath = nullptr; if (!SUCCEEDED(SHGetKnownFolderPath(FOLDERID_LocalAppData, KF_FLAG_CREATE, nullptr, &wAppDataPath))) @@ -53,7 +53,7 @@ namespace hex { CoTaskMemFree(wAppDataPath); } - std::vector paths = { parentDir, appDataDir / "imhex" }; + std::vector paths = { parentDir, appDataDir / "imhex" }; switch (path) { case ImHexPath::Patterns: @@ -103,9 +103,9 @@ namespace hex { #elif defined(OS_MACOS) // Get path to special directories const auto exePath = getExecutablePath(); - const std::filesystem::path applicationSupportDir(getMacApplicationSupportDirectoryPath()); + const fs::path applicationSupportDir(getMacApplicationSupportDirectoryPath()); - std::vector paths = { exePath, applicationSupportDir }; + std::vector paths = { exePath, applicationSupportDir }; switch (path) { case ImHexPath::Patterns: @@ -140,8 +140,8 @@ namespace hex { default: __builtin_unreachable(); } #else - std::vector configDirs = xdg::ConfigDirs(); - std::vector dataDirs = xdg::DataDirs(); + std::vector configDirs = xdg::ConfigDirs(); + std::vector dataDirs = xdg::DataDirs(); configDirs.insert(configDirs.begin(), xdg::ConfigHomeDir()); dataDirs.insert(dataDirs.begin(), xdg::DataHomeDir()); @@ -152,7 +152,7 @@ namespace hex { const auto exePath = getExecutablePath(); if (!exePath.empty()) - dataDirs.emplace(dataDirs.begin(), std::filesystem::path(exePath.data()).parent_path()); + dataDirs.emplace(dataDirs.begin(), fs::path(exePath.data()).parent_path()); switch (path) { case ImHexPath::Patterns: @@ -197,7 +197,7 @@ namespace hex { if (!listNonExisting) { result.erase(std::remove_if(result.begin(), result.end(), [](const auto& path){ - return !std::filesystem::is_directory(path); + return !fs::is_directory(path); }), result.end()); } diff --git a/plugins/libimhex/source/pattern_language/preprocessor.cpp b/plugins/libimhex/source/pattern_language/preprocessor.cpp index acb740dbb..ec27e3480 100644 --- a/plugins/libimhex/source/pattern_language/preprocessor.cpp +++ b/plugins/libimhex/source/pattern_language/preprocessor.cpp @@ -67,8 +67,8 @@ namespace hex::pl { if (includeFile[0] != '/') { for (const auto &dir : hex::getPath(ImHexPath::PatternsInclude)) { - std::string tempPath = hex::format("{0}/{1}", dir.c_str(), includeFile.c_str()); - if (std::filesystem::exists(tempPath)) { + std::string tempPath = hex::format("{0}/{1}", dir.string().c_str(), includeFile.c_str()); + if (fs::exists(tempPath)) { includePath = tempPath; break; } diff --git a/source/helpers/plugin_manager.cpp b/source/helpers/plugin_manager.cpp index 8514ec591..201588335 100644 --- a/source/helpers/plugin_manager.cpp +++ b/source/helpers/plugin_manager.cpp @@ -1,13 +1,12 @@ #include "helpers/plugin_manager.hpp" #include +#include #include namespace hex { - namespace fs = std::filesystem; - // hex::plugin::::internal::initializePlugin() constexpr auto InitializePluginSymbol = "_ZN3hex6plugin{0}{1}8internal16initializePluginEv"; constexpr auto GetPluginNameSymbol = "_ZN3hex6plugin{0}{1}8internal13getPluginNameEv"; @@ -84,13 +83,13 @@ namespace hex { this->m_setImGuiContextFunction(ctx); } - bool PluginManager::load(const std::string &pluginFolder) { - if (!std::filesystem::exists(pluginFolder)) + bool PluginManager::load(const fs::path &pluginFolder) { + if (!fs::exists(pluginFolder)) return false; PluginManager::s_pluginFolder = pluginFolder; - for (auto& pluginPath : std::filesystem::directory_iterator(pluginFolder)) { + for (auto& pluginPath : fs::directory_iterator(pluginFolder)) { if (pluginPath.is_regular_file() && pluginPath.path().extension() == ".hexplug") PluginManager::s_plugins.emplace_back(pluginPath.path().string()); } diff --git a/source/init/tasks.cpp b/source/init/tasks.cpp index c89846f39..ddf464098 100644 --- a/source/init/tasks.cpp +++ b/source/init/tasks.cpp @@ -25,7 +25,7 @@ namespace hex::init { static bool checkForUpdates() { hex::Net net; - auto releases = net.getJson(GitHubApiURL + "/releases/latest"s, 200).get(); + auto releases = net.getJson(GitHubApiURL + "/releases/latest"s, 2000).get(); if (releases.code != 200) return false; @@ -72,7 +72,7 @@ namespace hex::init { for (auto path : paths) { for (auto &folder : hex::getPath(path, true)) { try { - std::filesystem::create_directories(folder); + fs::create_directories(folder); } catch (...) { result = false; } @@ -92,10 +92,10 @@ namespace hex::init { fonts = IM_NEW(ImFontAtlas)(); cfg = { }; - std::string fontFile; + fs::path fontFile; for (const auto &dir : hex::getPath(ImHexPath::Resources)) { - auto path = dir + "/font.ttf"; - if (std::filesystem::exists(path)) { + auto path = dir / "font.ttf"; + if (fs::exists(path)) { fontFile = path; break; } @@ -146,7 +146,7 @@ namespace hex::init { cfg.OversampleH = cfg.OversampleV = 1, cfg.PixelSnapH = true; cfg.SizePixels = fontSize * SharedData::fontScale; - fonts->AddFontFromFileTTF(fontFile.c_str(), std::floor(fontSize * SharedData::fontScale), &cfg, ranges.Data); // Needs conversion to char for Windows + fonts->AddFontFromFileTTF(fontFile.string().c_str(), std::floor(fontSize * SharedData::fontScale), &cfg, ranges.Data); // Needs conversion to char for Windows } cfg.MergeMode = true; diff --git a/source/window/window.cpp b/source/window/window.cpp index 685af084b..62ebd34bd 100644 --- a/source/window/window.cpp +++ b/source/window/window.cpp @@ -237,7 +237,7 @@ namespace hex { return; for (const auto &path : hex::getPath(ImHexPath::Config)) { - if (ProjectFile::store((std::filesystem::path(path) / CrashBackupFileName).string())) + if (ProjectFile::store((fs::path(path) / CrashBackupFileName).string())) break; } }); @@ -247,7 +247,7 @@ namespace hex { }); for (const auto &path : hex::getPath(ImHexPath::Config)) { - if (auto filePath = std::filesystem::path(path) / CrashBackupFileName; std::filesystem::exists(filePath)) { + if (auto filePath = fs::path(path) / CrashBackupFileName; fs::exists(filePath)) { this->m_safetyBackupPath = filePath; View::doLater([]{ ImGui::OpenPopup("hex.safety_backup.title"_lang); }); } @@ -478,14 +478,14 @@ namespace hex { ProjectFile::markDirty(); ProjectFile::clearProjectFilePath(); - std::filesystem::remove(this->m_safetyBackupPath); + fs::remove(this->m_safetyBackupPath); ImGui::CloseCurrentPopup(); } ImGui::SameLine(); ImGui::SetCursorPosX(width / 9 * 5); if (ImGui::Button("hex.safety_backup.delete"_lang, ImVec2(width / 3, 0))) { - std::filesystem::remove(this->m_safetyBackupPath); + fs::remove(this->m_safetyBackupPath); ImGui::CloseCurrentPopup(); } @@ -630,7 +630,7 @@ namespace hex { { if (!SharedData::recentFilePaths.empty()) { for (auto &path : SharedData::recentFilePaths) { - if (ImGui::BulletHyperlink(std::filesystem::path(path).filename().string().c_str())) { + if (ImGui::BulletHyperlink(fs::path(path).filename().string().c_str())) { EventManager::post(path); break; } @@ -997,7 +997,7 @@ namespace hex { static std::string iniFileName; for (const auto &dir : hex::getPath(ImHexPath::Config)) { if (std::filesystem::exists(dir)) { - iniFileName = dir + "/interface.ini"; + iniFileName = (dir / "interface.ini").string(); break; } }