From 2f6f0d8cf6a69385f055a172dae8a2771a6395e9 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Fri, 4 Oct 2019 10:54:03 +0200 Subject: [PATCH] use filesystem::path instead of string to hold include paths passed on the command line --- src/ConfigFile.cc | 5 +++-- src/ConfigFile.hh | 2 +- src/DynareMain.cc | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ConfigFile.cc b/src/ConfigFile.cc index b9fc93a4..d1b2d314 100644 --- a/src/ConfigFile.cc +++ b/src/ConfigFile.cc @@ -21,6 +21,7 @@ #include <fstream> #include <utility> #include <vector> +#include <filesystem> #include "ConfigFile.hh" @@ -679,10 +680,10 @@ ConfigFile::transformPass() member_node.second /= weight_denominator; } -vector<string> +vector<filesystem::path> ConfigFile::getIncludePaths() const { - vector<string> include_paths; + vector<filesystem::path> include_paths; for (auto path : paths) for (const auto & mapit : path.get_paths()) for (const auto & vecit : mapit.second) diff --git a/src/ConfigFile.hh b/src/ConfigFile.hh index 5e5dbada..ad1c9b5c 100644 --- a/src/ConfigFile.hh +++ b/src/ConfigFile.hh @@ -130,7 +130,7 @@ public: //! Check Pass void transformPass(); //! Get Path Info - vector<string> getIncludePaths() const; + vector<filesystem::path> getIncludePaths() const; //! Write any hooks void writeHooks(ostream &output) const; //! Create options_.parallel structure, write options diff --git a/src/DynareMain.cc b/src/DynareMain.cc index 06a1e547..bd21ebe3 100644 --- a/src/DynareMain.cc +++ b/src/DynareMain.cc @@ -408,8 +408,7 @@ main(int argc, char **argv) // If Include option was passed to the [paths] block of the config file, add // it to paths before macroprocessing - vector<string> config_include_paths = config_file.getIncludePaths(); - for (const auto &it : config_include_paths) + for (const auto &it : config_file.getIncludePaths()) paths.emplace_back(it); // Do macro processing -- GitLab