From 1907a0d70fead710feb6908776d9142a59b23f74 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Fri, 29 Apr 2022 06:30:12 +0100 Subject: [PATCH] Cast path to string --- include/fdp/registry/data_io.hxx | 2 +- src/objects/metadata.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fdp/registry/data_io.hxx b/include/fdp/registry/data_io.hxx index 60f47c0..b52eed1 100644 --- a/include/fdp/registry/data_io.hxx +++ b/include/fdp/registry/data_io.hxx @@ -77,7 +77,7 @@ ghc::filesystem::path create_estimate(T &value, ghc::filesystem::create_directories(output_filename_.parent_path()); } - toml_out_.open(output_filename_); + toml_out_.open(output_filename_.string()); if (!toml_out_) { throw std::runtime_error("Failed to open TOML file for writing"); diff --git a/src/objects/metadata.cxx b/src/objects/metadata.cxx index 05ce8ed..6286a0f 100644 --- a/src/objects/metadata.cxx +++ b/src/objects/metadata.cxx @@ -6,7 +6,7 @@ std::string calculate_hash_from_file(const ghc::filesystem::path &file_path) { throw std::invalid_argument("File '" + file_path.string() + "' not found"); } - std::ifstream file_(file_path, std::ios_base::in | std::ios_base::binary); + std::ifstream file_(file_path.string(), std::ios_base::in | std::ios_base::binary); const std::string hash_ = digestpp::sha1().absorb(file_).hexdigest(); @@ -78,7 +78,7 @@ bool file_exists( const std::string &Filename ) } std::string read_token(const ghc::filesystem::path &token_path){ - std::ifstream key_(token_path, std::ios::in); + std::ifstream key_(token_path.string(), std::ios::in); std::string key_str_; key_ >> key_str_; key_.close();