8 #include "artdaq-core/Utilities/SimpleLookupPolicy.h"
9 #include "cetlib/filesystem.h"
22 cwdPath_.reset(
new cet::search_path(
".:."));
26 fallbackPaths_.reset(
new cet::search_path(
".:."));
30 if (argType == PATH_STRING) {
31 std::string workString(paths);
32 if (workString.find(
':') == std::string::npos) {
33 workString.append(
":");
34 workString.append(paths);
36 fallbackPaths_.reset(
new cet::search_path(workString));
40 fallbackPaths_.reset(
new cet::search_path(paths));
44 std::string artdaq::SimpleLookupPolicy::operator() (std::string
const &filename)
46 if (cet::is_absolute_filepath(filename)) {
51 return cwdPath_->find_file(filename);
55 return fallbackPaths_->find_file(filename);
58 artdaq::SimpleLookupPolicy::~SimpleLookupPolicy() noexcept
SimpleLookupPolicy(std::string const &paths, ArgType argType=ENV_VAR)