11 #include "cetlib_except/exception.h" 79 std::cerr <<
"search path empty (nonexistent environment variable" 80 << (paths.empty() ?
"" :
std::string(
" ") + paths) <<
")?\n" 81 <<
"Any included configurations will not be found by this lookup " 107 std::unique_ptr<filepath_maker>
111 if (policy == none()) {
112 return std::make_unique<filepath_maker>();
115 if (policy ==
all()) {
116 return std::make_unique<filepath_lookup>(
move(env_or_paths));
119 if (policy == nonabsolute()) {
120 return std::make_unique<filepath_lookup_nonabsolute>(
move(env_or_paths));
123 if (policy == after1()) {
124 return std::make_unique<filepath_lookup_after1>(
move(env_or_paths));
127 if (policy == permissive()) {
129 if (
empty(search_paths)) {
132 search_paths = env_or_paths;
134 return std::make_unique<filepath_first_absolute_or_lookup_with_dot>(
139 <<
"An unsupported file-lookup policy was selected.";
146 std::map<std::string, std::vector<std::string>> policies;
147 policies.emplace(none(),
std::vector{
"No lookup is done for any files."s});
150 std::vector{
"Lookup is performed for all files presented to the filepath-"s,
154 std::vector{
"Lookup is performed only for files that are not absolute--"s,
155 "i.e. file names not beginning with the '/' character."s});
158 std::vector{
"No lookup for the first file, and only lookup is performed"s,
159 "for all subsequent files."s});
163 "The first file can be an absolute path, a path relative to '.',"s,
164 "or a path that can be looked up; all subsequent files must be"s,
165 "looked up. This is the policy used by the art framework; it is"s,
166 "sometimes referred to as the first-absolute-or-lookup-with-dot"s,
std::string operator()(std::string const &filename) override
filepath_lookup_nonabsolute(std::string paths)
filepath_first_absolute_or_lookup_with_dot(std::string paths)
std::unique_ptr< filepath_maker > select(std::string const &spec, std::string paths) const
std::string getenv(std::string const &name)
std::string operator()(std::string const &filename) override
filepath_lookup_after1(std::string paths)
bool is_absolute_filepath(std::string const &qualified_filename)
cet::search_path after_paths
static QInternalList< QTextCodec > * all
cet::search_path first_paths
void line(double t, double *p, double &x, double &y, double &z)
std::string find_file(std::string const &filename) const
std::string operator()(std::string const &filename) override
std::string operator()(std::string const &filename) override
filepath_lookup(std::string paths)
cet::coded_exception< error, detail::translate > exception
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
std::string help_message() const