diff --git a/src/libs/antares/study/area/links.cpp b/src/libs/antares/study/area/links.cpp index ea7b8811f9..fa70cc855e 100644 --- a/src/libs/antares/study/area/links.cpp +++ b/src/libs/antares/study/area/links.cpp @@ -188,7 +188,7 @@ void AreaLink::storeTimeseriesNumbers(Solver::IResultWriter& writer) const std::string buffer; timeseriesNumbers.saveToBuffer(buffer); - writer.addEntryFromBuffer(path.string(), buffer); + writer.addEntryFromBuffer(path, buffer); } void AreaLink::detach() diff --git a/src/libs/antares/study/area/store-timeseries-numbers.cpp b/src/libs/antares/study/area/store-timeseries-numbers.cpp index 75d5f91896..daa3a250c8 100644 --- a/src/libs/antares/study/area/store-timeseries-numbers.cpp +++ b/src/libs/antares/study/area/store-timeseries-numbers.cpp @@ -40,7 +40,7 @@ static void storeTSnumbers(Solver::IResultWriter& writer, std::string buffer; timeseriesNumbers.saveToBuffer(buffer); - writer.addEntryFromBuffer(path.string(), buffer); + writer.addEntryFromBuffer(path, buffer); } void storeTimeseriesNumbersForLoad(Solver::IResultWriter& writer, const Area& area) diff --git a/src/libs/antares/study/parts/common/cluster_list.cpp b/src/libs/antares/study/parts/common/cluster_list.cpp index b8e16c5081..2551c507cf 100644 --- a/src/libs/antares/study/parts/common/cluster_list.cpp +++ b/src/libs/antares/study/parts/common/cluster_list.cpp @@ -28,7 +28,7 @@ #include #include "antares/study/study.h" -using namespace Yuni; +namespace fs = std::filesystem; namespace Antares::Data { @@ -88,21 +88,19 @@ void ClusterList::resizeAllTimeseriesNumbers(uint n) const } } -#define SEP IO::Separator - template void ClusterList::storeTimeseriesNumbers(Solver::IResultWriter& writer) const { - Clob path; std::string ts_content; + fs::path basePath = fs::path("ts-numbers") / typeID(); for (auto& cluster: each_enabled()) { - path.clear() << "ts-numbers" << SEP << typeID() << SEP << cluster->parentArea->id << SEP - << cluster->id() << ".txt"; + fs::path path = fs::path(cluster->parentArea->id) / std::string(cluster->id() + ".txt"); + ts_content.clear(); // We must clear ts_content here, since saveToBuffer does not do it. cluster->series.timeseriesNumbers.saveToBuffer(ts_content); - writer.addEntryFromBuffer(path.c_str(), ts_content); + writer.addEntryFromBuffer(path, ts_content); } }