From 03f810f9f0f0874dc2c507cf3f3fc23a50ec39e1 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Mon, 31 Jul 2023 13:03:46 +0200 Subject: [PATCH] Remove implicit conversion from std::filesystem::path to std::string --- .../thermal-price-definition.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tests/src/libs/antares/study/thermal-price-definition/thermal-price-definition.cpp b/src/tests/src/libs/antares/study/thermal-price-definition/thermal-price-definition.cpp index b0ad3f7029..c0e4ebc39a 100644 --- a/src/tests/src/libs/antares/study/thermal-price-definition/thermal-price-definition.cpp +++ b/src/tests/src/libs/antares/study/thermal-price-definition/thermal-price-definition.cpp @@ -17,13 +17,14 @@ const auto SEP = Yuni::IO::Separator; using namespace Antares::Data; +using std::filesystem::temp_directory_path; // Use RAII to simplify teardown struct ThermalIniFile { explicit ThermalIniFile() { - const auto folder = std::filesystem::temp_directory_path(); + const auto folder = temp_directory_path(); std::ofstream outfile(folder / "list.ini", std::ofstream::out | std::ofstream::trunc); outfile << "[area]" << std::endl; @@ -48,7 +49,7 @@ struct ThermalIniFile ~ThermalIniFile() noexcept { - auto folder = std::filesystem::temp_directory_path(); + auto folder = temp_directory_path(); std::filesystem::remove(folder / "list.ini"); } }; @@ -57,7 +58,7 @@ struct SeriesFile { SeriesFile(const std::string& name, std::size_t size) : name_(name) { - folder = std::filesystem::temp_directory_path(); + folder = temp_directory_path(); std::ofstream outfile(folder / name, std::ofstream::out | std::ofstream::trunc); for (std::size_t i = 0; i < size; i++) @@ -72,7 +73,7 @@ struct SeriesFile } std::string getFolder() { - return folder; + return folder.string(); } private: @@ -116,7 +117,7 @@ struct FixtureFull : private ThermalIniFile study->parameters.include.thermal.minUPTime = true; study->parameters.include.thermal.minStablePower = true; study->parameters.include.reserve.spinning = true; - folder = std::filesystem::temp_directory_path(); + folder = temp_directory_path().string(); } std::string folder;