1 #include "artdaq-core/Utilities/SimpleLookupPolicy.hh"
2 #include "cetlib/filesystem.h"
15 cwdPath_.reset(
new cet::search_path(
".:."));
20 fallbackPaths_.reset(
new cet::search_path(
".:."));
26 auto workString(paths);
27 if (workString.find(
':') == std::string::npos)
29 workString.append(
":");
30 workString.append(paths);
32 fallbackPaths_.reset(
new cet::search_path(workString));
37 fallbackPaths_.reset(
new cet::search_path(paths));
43 if (cet::is_absolute_filepath(filename))
50 return cwdPath_->find_file(filename);
55 return fallbackPaths_->find_file(filename);
SimpleLookupPolicy(std::string const &paths, ArgType argType=ArgType::ENV_VAR)
Constructor.
Constructor argument is a list of directories.
virtual ~SimpleLookupPolicy() noexcept
Default destructor.
ArgType
Flag if the constructor argument is a list of paths or the name of an environment variable...
std::string operator()(std::string const &filename) override
Perform the file lookup.