From b4a2a7479b7db90d537d42a7879ed016502eb08d Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 19 Dec 2024 11:39:54 +0100 Subject: [PATCH] add function to read one lib file --- src/solver/modeler/loadFiles/readLibraries.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/solver/modeler/loadFiles/readLibraries.cpp b/src/solver/modeler/loadFiles/readLibraries.cpp index d0acff1a97..f96c333d08 100644 --- a/src/solver/modeler/loadFiles/readLibraries.cpp +++ b/src/solver/modeler/loadFiles/readLibraries.cpp @@ -20,8 +20,8 @@ */ #include -#include #include +#include #include "antares/solver/loadFiles/loadFiles.h" namespace fs = std::filesystem; @@ -29,10 +29,13 @@ namespace fs = std::filesystem; namespace Antares::Solver::LoadFiles { -Study::SystemModel::Library loadSingleLibrary(const fs::path& filePath) +static Study::SystemModel::Library loadSingleLibrary(const fs::path& filePath) { - Study::SystemModel::Library lib; - return lib; + const std::string libraryStr = IO::readFile(filePath); + + ModelParser::Parser parser; + ModelParser::Library libraryObj = parser.parse(libraryStr); + return ModelConverter::convert(libraryObj); } } // namespace Antares::Solver::LoadFiles