search for files in a list of directories
More...
#include </tmp/marcocle/lhcb-release/1122/GAUDI/GAUDI_v27r0/InstallArea/x86_64-slc6-gcc49-opt/include/GaudiKernel/DirSearchPath.h>
|
typedef boost::filesystem::path | path |
|
typedef boost::filesystem::path | path |
|
|
|
| DirSearchPath () |
|
| DirSearchPath (const std::string &stringifiedPath, const char *separator=",:") |
|
| DirSearchPath () |
|
| DirSearchPath (const std::string &stringifiedPath, const char *separator=",:") |
|
|
bool | add (const path &dir) |
|
bool | addCWD () |
| add current work dir (*nix pwd) to path More...
|
|
bool | add (const path &dir) |
|
bool | addCWD () |
| add current work dir (*nix pwd) to path More...
|
|
|
bool | find (const std::string &fileName, std::string &fullFileName) const |
| returns a flag if fileName found in search path, and sets ref to fully qualified file name (in native form) More...
|
|
bool | find (const path &file, path &fileFound) const |
| returns a flag if file found in search path. Sets ref to completed path More...
|
|
std::list< path > | find_all (const path &file) const |
| returns lists of files found in search path. More...
|
|
bool | find (const std::string &fileName, std::string &fullFileName) const |
| returns a flag if fileName found in search path, and sets ref to fully qualified file name (in native form) More...
|
|
bool | find (const path &file, path &fileFound) const |
| returns a flag if file found in search path. Sets ref to completed path More...
|
|
std::list< path > | find_all (const path &file) const |
| returns lists of files found in search path. More...
|
|
search for files in a list of directories
- Author
- Paolo Calafiura pcala.nosp@m.fiur.nosp@m.a@lbl.nosp@m..gov - ATLAS Collaboration
Definition at line 17 of file DirSearchPath.h.
DirSearchPath::DirSearchPath |
( |
| ) |
|
|
inline |
Definition at line 23 of file DirSearchPath.h.
bool addCWD()
add current work dir (*nix pwd) to path
DirSearchPath::DirSearchPath |
( |
const std::string & |
stringifiedPath, |
|
|
const char * |
separator = ",:" |
|
) |
| |
- Exceptions
-
boost::filesystem::filesystem_error | |
Definition at line 29 of file DirSearchPath.cpp.
32 typedef tokenizer<char_separator<char> > Tokenizer;
34 Tokenizer tok(stringifiedPath, char_separator<char>(separator));
38 auto it = tok.begin();
39 while(it != tok.end()) {
44 catch (boost::filesystem::filesystem_error &) {
boost::filesystem::path path
bool add(const path &dir)
bool addCWD()
add current work dir (*nix pwd) to path
DirSearchPath::DirSearchPath |
( |
| ) |
|
|
inline |
Definition at line 23 of file DirSearchPath.h.
bool addCWD()
add current work dir (*nix pwd) to path
DirSearchPath::DirSearchPath |
( |
const std::string & |
stringifiedPath, |
|
|
const char * |
separator = ",:" |
|
) |
| |
- Exceptions
-
boost::filesystem::filesystem_error | |
bool DirSearchPath::add |
( |
const path & |
dir | ) |
|
- Exceptions
-
Definition at line 54 of file DirSearchPath.cpp.
std::vector< path > m_dirs
the dir container
static bool existsDir(const std::string &dirName)
check dirName is valid
bool DirSearchPath::add |
( |
const path & |
dir | ) |
|
bool DirSearchPath::addCWD |
( |
| ) |
|
add current work dir (*nix pwd) to path
Definition at line 50 of file DirSearchPath.cpp.
51 return add(boost::filesystem::current_path());
bool add(const path &dir)
bool DirSearchPath::addCWD |
( |
| ) |
|
add current work dir (*nix pwd) to path
bool DirSearchPath::existsDir |
( |
const std::string & |
dirName | ) |
|
|
static |
check dirName is valid
Definition at line 100 of file DirSearchPath.cpp.
103 rc=is_directory(
path(dirName));
boost::filesystem::path path
static bool DirSearchPath::existsDir |
( |
const std::string & |
dirName | ) |
|
|
static |
static bool DirSearchPath::existsDir |
( |
const path & |
dir | ) |
|
|
static |
bool DirSearchPath::existsDir |
( |
const path & |
dir | ) |
|
|
static |
check dir path is valid
Definition at line 107 of file DirSearchPath.cpp.
108 return (exists(dir) && is_directory(dir));
bool DirSearchPath::find |
( |
const std::string & |
fileName, |
|
|
std::string & |
fullFileName |
|
) |
| const |
returns a flag if fileName found in search path, and sets ref to fully qualified file name (in native form)
Definition at line 64 of file DirSearchPath.cpp.
69 fullFileName = fileFound.string();
boost::filesystem::path path
bool find(const std::string &fileName, std::string &fullFileName) const
returns a flag if fileName found in search path, and sets ref to fully qualified file name (in native...
bool DirSearchPath::find |
( |
const std::string & |
fileName, |
|
|
std::string & |
fullFileName |
|
) |
| const |
returns a flag if fileName found in search path, and sets ref to fully qualified file name (in native form)
bool DirSearchPath::find |
( |
const path & |
file, |
|
|
path & |
fileFound |
|
) |
| const |
returns a flag if file found in search path. Sets ref to completed path
Definition at line 75 of file DirSearchPath.cpp.
77 for (
const auto& iDir :
m_dirs ) {
std::vector< path > m_dirs
the dir container
boost::filesystem::path path
bool DirSearchPath::find |
( |
const path & |
file, |
|
|
path & |
fileFound |
|
) |
| const |
returns a flag if file found in search path. Sets ref to completed path
std::list<path> DirSearchPath::find_all |
( |
const path & |
file | ) |
const |
returns lists of files found in search path.
returns lists of files found in search path.
Definition at line 90 of file DirSearchPath.cpp.
91 std::list<path> found;
92 for (
const auto& iDir :
m_dirs ) {
94 if (exists(full)) found.push_back(full);
std::vector< path > m_dirs
the dir container
boost::filesystem::path path
std::vector< path > DirSearchPath::m_dirs |
|
private |
The documentation for this class was generated from the following files: