mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
sys: std::filesystem -> fs
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <hex.hpp>
|
||||
#include <hex/helpers/concepts.hpp>
|
||||
#include <hex/helpers/paths.hpp>
|
||||
|
||||
#include <hex/pattern_language/token.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/event.hpp>
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <nlohmann/json_fwd.hpp>
|
||||
#include <curl/system.h>
|
||||
|
||||
#include <hex/helpers/paths.hpp>
|
||||
|
||||
using CURL = void;
|
||||
struct curl_slist;
|
||||
|
||||
@@ -36,8 +38,8 @@ namespace hex {
|
||||
std::future<Response<std::string>> getString(const std::string &url, u32 timeout = 2000);
|
||||
std::future<Response<nlohmann::json>> getJson(const std::string &url, u32 timeout = 2000);
|
||||
|
||||
std::future<Response<std::string>> uploadFile(const std::string &url, const std::filesystem::path &filePath, u32 timeout = 2000);
|
||||
std::future<Response<void>> downloadFile(const std::string &url, const std::filesystem::path &filePath, u32 timeout = 2000);
|
||||
std::future<Response<std::string>> uploadFile(const std::string &url, const fs::path &filePath, u32 timeout = 2000);
|
||||
std::future<Response<void>> downloadFile(const std::string &url, const fs::path &filePath, u32 timeout = 2000);
|
||||
|
||||
[[nodiscard]]
|
||||
std::string encode(const std::string &input);
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <filesystem>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
enum class ImHexPath {
|
||||
Patterns,
|
||||
PatternsInclude,
|
||||
@@ -19,6 +22,6 @@ namespace hex {
|
||||
|
||||
std::string getExecutablePath();
|
||||
|
||||
std::vector<std::string> getPath(ImHexPath path, bool listNonExisting = false);
|
||||
std::vector<fs::path> getPath(ImHexPath path, bool listNonExisting = false);
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/event.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
#include <hex/helpers/paths.hpp>
|
||||
|
||||
namespace hex {
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace hex {
|
||||
ProjectFile::s_hasUnsavedChanged = true;
|
||||
|
||||
if (setWindowTitle)
|
||||
EventManager::post<RequestChangeWindowTitle>(std::filesystem::path(getFilePath()).filename().string());
|
||||
EventManager::post<RequestChangeWindowTitle>(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<RequestChangeWindowTitle>(std::filesystem::path(filePath).filename().string());
|
||||
EventManager::post<RequestChangeWindowTitle>(fs::path(filePath).filename().string());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user