10 #include <framework/utilities/EnvironmentVariables.h>
11 #include <boost/algorithm/string.hpp>
12 #include <boost/python/import.hpp>
13 #include <boost/python/extract.hpp>
23 char* envValue = std::getenv(name.c_str());
24 return envValue !=
nullptr;
29 char* envValue = std::getenv(name.c_str());
30 if (envValue !=
nullptr) {
31 std::string val(envValue);
39 const std::string& separators)
41 if (!
isSet(name))
return fallback;
42 std::string value =
get(name);
43 std::vector<std::string> items;
45 if (value.empty())
return items;
46 boost::split(items, value, boost::is_any_of(separators));
51 const std::string& separators)
54 std::string value =
get(name, fallback);
55 std::vector<std::string> items;
57 if (value.empty())
return items;
58 boost::split(items, value, boost::is_any_of(separators));
66 namespace py = boost::python;
67 py::object path = py::import(
"os.path");
68 return py::extract<std::string>(path.attr(
"expandvars")(text));