6 #include <boost/filesystem.hpp>
7 #include "pinocchio/utils/file-explorer.hpp"
9 namespace fs = boost::filesystem;
14 std::vector<std::string> & list_of_paths,
15 const std::string & delimiter)
17 const char * env_var_value = std::getenv(env_var_name.c_str());
19 if(env_var_value != NULL)
21 std::string policyStr(env_var_value);
23 policyStr += delimiter;
24 size_t lastOffset = 0;
27 size_t offset = policyStr.find_first_of(delimiter, lastOffset);
28 if (offset < policyStr.size())
29 list_of_paths.push_back(policyStr.substr(lastOffset, offset - lastOffset));
30 if (offset == std::string::npos)
33 lastOffset = offset + 1;
39 const std::string & delimiter)
41 std::vector<std::string> list_of_paths;
48 std::vector<std::string> raw_list_of_paths;
55 std::vector<std::string> list_of_paths;
56 for (std::vector<std::string>::iterator it = raw_list_of_paths.begin(); it != raw_list_of_paths.end(); ++it) {
57 list_of_paths.push_back(*it);
59 if (fs::exists(path /
"package.xml")) {
60 list_of_paths.push_back(fs::path(path /
"..").
string());