5 #pragma warning(disable:4996)
13 #pragma warning(disable:279)
15 #include "boost/filesystem/operations.hpp"
16 #include "boost/tokenizer.hpp"
21 using boost::filesystem::filesystem_error;
22 using boost::filesystem::exists;
23 using boost::filesystem::is_directory;
25 using boost::tokenizer;
26 using boost::char_separator;
32 typedef tokenizer<char_separator<char> >
Tokenizer;
34 Tokenizer tok(stringifiedPath, char_separator<char>(separator));
38 Tokenizer::iterator it = tok.begin();
39 while(it != tok.end()) {
44 catch (boost::filesystem::filesystem_error &) {
51 return add(boost::filesystem::current_path());
55 bool dirExist(existsDir(dir));
58 if (m_dirs.end() == std::find_if(m_dirs.begin(), m_dirs.end(),
eqPath(dir)))
59 m_dirs.push_back(dir);
68 if ( (rc = find(
path(fileName), fileFound)) )
69 fullFileName = fileFound.string();
77 for (std::list<path>::const_iterator iDir=m_dirs.begin(); iDir!=m_dirs.end(); ++iDir) {
78 path full(*iDir / file);
89 std::list<DirSearchPath::path>
91 std::list<path> found;
92 for (std::list<path>::const_iterator iDir=m_dirs.begin(); iDir!=m_dirs.end(); ++iDir) {
93 path full(*iDir / file);
95 found.push_back(full);
105 rc=is_directory(
path(dirName));
110 return (exists(dir) && is_directory(dir));
boost::filesystem::path path
bool add(const path &dir)
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...
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
std::list< path > find_all(const path &file) const
returns lists of files found in search path.
bool addCWD()
add current work dir (*nix pwd) to path
search for files in a list of directories
static bool existsDir(const std::string &dirName)
check dirName is valid