Skip to content
Snippets Groups Projects
Commit 4904b730 authored by Houtan Bastani's avatar Houtan Bastani Committed by Stéphane Adjemian
Browse files

use filesystem::path instead of string to hold include paths passed on the command line

(cherry picked from commit 2f6f0d8c)
parent 031bc62f
Branches
Tags
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <fstream> #include <fstream>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <filesystem>
#include "ConfigFile.hh" #include "ConfigFile.hh"
...@@ -679,10 +680,10 @@ ConfigFile::transformPass() ...@@ -679,10 +680,10 @@ ConfigFile::transformPass()
member_node.second /= weight_denominator; member_node.second /= weight_denominator;
} }
vector<string> vector<filesystem::path>
ConfigFile::getIncludePaths() const ConfigFile::getIncludePaths() const
{ {
vector<string> include_paths; vector<filesystem::path> include_paths;
for (auto path : paths) for (auto path : paths)
for (const auto & mapit : path.get_paths()) for (const auto & mapit : path.get_paths())
for (const auto & vecit : mapit.second) for (const auto & vecit : mapit.second)
......
...@@ -130,7 +130,7 @@ public: ...@@ -130,7 +130,7 @@ public:
//! Check Pass //! Check Pass
void transformPass(); void transformPass();
//! Get Path Info //! Get Path Info
vector<string> getIncludePaths() const; vector<filesystem::path> getIncludePaths() const;
//! Write any hooks //! Write any hooks
void writeHooks(ostream &output) const; void writeHooks(ostream &output) const;
//! Create options_.parallel structure, write options //! Create options_.parallel structure, write options
......
...@@ -408,8 +408,7 @@ main(int argc, char **argv) ...@@ -408,8 +408,7 @@ main(int argc, char **argv)
// If Include option was passed to the [paths] block of the config file, add // If Include option was passed to the [paths] block of the config file, add
// it to paths before macroprocessing // it to paths before macroprocessing
vector<string> config_include_paths = config_file.getIncludePaths(); for (const auto &it : config_file.getIncludePaths())
for (const auto &it : config_include_paths)
paths.emplace_back(it); paths.emplace_back(it);
// Do macro processing // Do macro processing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment