From d7c462a8138f88ca209eafabb2442d11737be144 Mon Sep 17 00:00:00 2001 From: Colin Edwards Date: Wed, 16 Oct 2019 20:43:14 -0500 Subject: [PATCH] Add search path arg --- src/Settings.cpp | 5 +++++ src/Settings.h | 4 ++++ src/Utils.cpp | 14 ++++++++++++++ src/main.cpp | 6 ++++++ 4 files changed, 29 insertions(+) diff --git a/src/Settings.cpp b/src/Settings.cpp index 7f4ad36..5a74e0b 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -97,4 +97,9 @@ bool isPrefixBundled(std::string prefix) return true; } +std::vector searchPaths; +void addSearchPath(std::string path){ searchPaths.push_back(path); } +int searchPathAmount(){ return searchPaths.size(); } +std::string searchPath(const int n){ return searchPaths[n]; } + } diff --git a/src/Settings.h b/src/Settings.h index 4990ce5..f1e7040 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -56,5 +56,9 @@ std::string fileToFix(const int n); std::string inside_lib_path(); void inside_lib_path(std::string p); +void addSearchPath(std::string path); +int searchPathAmount(); +std::string searchPath(const int n); + } #endif diff --git a/src/Utils.cpp b/src/Utils.cpp index 05ff76e..3c7f4c2 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -169,6 +169,20 @@ int systemp(std::string& cmd) std::string getUserInputDirForFile(const std::string& filename) { + const int searchPathAmount = Settings::searchPathAmount(); + for(int n=0; n0) { // if we meet an unknown flag, abort