#include <search_path.h>
Definition at line 36 of file search_path.h.
search_path::search_path |
( |
std::string const & |
env_name_or_path | ) |
|
|
explicit |
Definition at line 62 of file search_path.cc.
63 :
env_{get_env_if_colon_present(env_name_or_path)}
std::vector< std::string > dirs_
search_path::search_path |
( |
std::string const & |
env_name, |
|
|
std::nothrow_t |
|
|
) |
| |
bool search_path::empty |
( |
| ) |
const |
Definition at line 96 of file search_path.cc.
102 <<
"Can't find file \"" <<
filename <<
'"';
std::string find_file(std::string const &filename) const
cet::coded_exception< error, detail::translate > exception
Definition at line 106 of file search_path.cc.
113 for (
size_t k; (
k = fullpath.find(
"//")) != string::npos;) {
114 fullpath.erase(
k, 1);
std::vector< std::string > dirs_
bool file_exists(std::string const &qualified_filename)
Definition at line 126 of file search_path.cc.
131 unique_ptr<DIR, function<int(DIR*)>> dd(opendir(
dir.c_str()), closedir);
132 if (dd.get() ==
nullptr) {
141 auto entry = readdir(dd.get());
144 <<
"Failed to read directory \"" <<
dir 145 <<
"\"; error num = " <<
errno;
147 if (
entry ==
nullptr) {
151 if (regex_match(
entry->d_name, re)) {
152 out.push_back(
dir +
'/' +
entry->d_name);
std::vector< std::string > dirs_
int errno
Contains the last error code.
cet::coded_exception< error, detail::translate > exception
template<class OutIter >
std::size_t cet::search_path::find_files |
( |
std::string const & |
filename_pattern, |
|
|
OutIter |
dest |
|
) |
| const |
Definition at line 102 of file search_path.h.
104 std::vector<std::string> results;
std::size_t find_files(std::string const &filename_pattern, std::vector< std::string > &result) const
auto copy_all(FwdCont &, FwdIter)
string const & search_path::operator[] |
( |
std::size_t |
k | ) |
const |
size_t search_path::size |
( |
| ) |
const |
The documentation for this class was generated from the following files: