sys: std::filesystem -> fs

This commit is contained in:
WerWolv
2022-01-13 14:33:30 +01:00
parent 27c08c1edf
commit c88d428fb5
24 changed files with 69 additions and 63 deletions

View File

@@ -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>

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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());
}