| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

DirSearchPath.h
Go to the documentation of this file.
1 #ifndef JOBOPTIONS_DIRSEARCHPATH_H
2 #define JOBOPTIONS_DIRSEARCHPATH_H
3
7 #include <vector>
8 #include <functional> /* binary_function */
9 #include <string>
10 #include "boost/filesystem/path.hpp"
11 #include "boost/filesystem/exception.hpp" /*filesystem_error*/
12 #include "GaudiKernel/Kernel.h" /* GAUDI_API */
17 class GAUDI_API DirSearchPath {
18 public:
19 typedef boost::filesystem::path path;
20
22
23 DirSearchPath() { addCWD(); }
25 #ifdef _WIN32
26 DirSearchPath(const std::string& stringifiedPath, const char* separator=",;");
27 #else
28 DirSearchPath(const std::string& stringifiedPath, const char* separator=",:");
29 #endif
30
31
33
34 // bool add(const std::string& dirName); ///< \throws filesystem_error
35 bool add(const path& dir);
36 bool addCWD();
37
38
40
41 bool find(const std::string& fileName, std::string& fullFileName) const;
45 bool find(const path& file, path& fileFound) const;
47 std::list<path> find_all(const path& file) const;
49
50
52
53 static bool existsDir(const std::string& dirName);
54 static bool existsDir(const path& dir);
55
56
57 private:
58 //
60 struct eqPath : public std::unary_function<const path&,bool> {
61 eqPath(const path& ref) : m_ref(ref) {}
62 bool operator() (const path& p) const {
63 return p.string() == m_ref.string();
64 }
65 private:
66 path m_ref;
67 };
68 // @class lessPath order paths by (system-independent) name
69 //struct lessPath : public std::binary_function<const path&,const path&,bool> {
70 // bool operator() (const path& lhs, const path& rhs) const {
71 // return lhs.string() < rhs.string();
72 // }
73 //};
75
76 // typedef std::set<path, lessPath> PathSet; ///<a set ordered by path name
77 // PathSet m_dirs; ///<the dir container
78 //
79 std::vector<path> m_dirs;
80 };
81 #endif // JOBOPTIONS_DIRSEARCHPATH_H
Kernel.h
DirSearchPath
search for files in a list of directories
Definition: DirSearchPath.h:17
DirSearchPath::path
boost::filesystem::path path
Definition: DirSearchPath.h:19
DirSearchPath::eqPath
name
Definition: DirSearchPath.h:60
DirSearchPath::eqPath::eqPath
eqPath(const path &ref)
Definition: DirSearchPath.h:61
std::string
STL class.
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:14
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:32
DirSearchPath::m_dirs
std::vector< path > m_dirs
the dir container
Definition: DirSearchPath.h:79
ana.file
list file
Definition: ana.py:160
std::list
STL class.
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
std::vector< path >
std::unary_function
DirSearchPath::eqPath::m_ref
path m_ref
Definition: DirSearchPath.h:66
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
DirSearchPath::DirSearchPath
DirSearchPath()
Definition: DirSearchPath.h:23