| The Gaudi Framework v29r1 (5cd95fa2)

- 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 "GaudiKernel/Kernel.h" /* GAUDI_API */
8 #include "boost/filesystem/exception.hpp" /*filesystem_error*/
9 #include "boost/filesystem/path.hpp"
10 #include <functional> /* binary_function */
11 #include <string>
12 #include <vector>
17 class GAUDI_API DirSearchPath
18 {
19 public:
20 typedef boost::filesystem::path path;
21
23
24 DirSearchPath() { addCWD(); }
26 #ifdef _WIN32
27 DirSearchPath( const std::string& stringifiedPath, const char* separator = ",;" );
28 #else
29 DirSearchPath( const std::string& stringifiedPath, const char* separator = ",:" );
30 #endif
31
32
34
35 // bool add(const std::string& dirName); ///< \throws filesystem_error
36 bool add( const path& dir );
37 bool addCWD();
38
39
41
42 bool find( const std::string& fileName, std::string& fullFileName ) const;
46 bool find( const path& file, path& fileFound ) const;
48 std::list<path> find_all( const path& file ) const;
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 {
61 eqPath( const path& ref ) : m_ref( ref ) {}
62 bool operator()( const path& p ) const { return p.string() == m_ref.string(); }
63
64 private:
65 path m_ref;
66 };
67 // @class lessPath order paths by (system-independent) name
68 // struct lessPath : public std::binary_function<const path&,const path&,bool> {
69 // bool operator() (const path& lhs, const path& rhs) const {
70 // return lhs.string() < rhs.string();
71 // }
72 //};
74
75 // typedef std::set<path, lessPath> PathSet; ///<a set ordered by path name
76 // PathSet m_dirs; ///<the dir container
77 //
78 std::vector<path> m_dirs;
79 };
80 #endif // JOBOPTIONS_DIRSEARCHPATH_H
Kernel.h
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DirSearchPath
search for files in a list of directories
Definition: DirSearchPath.h:17
DirSearchPath::path
boost::filesystem::path path
Definition: DirSearchPath.h:20
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:39
DirSearchPath::m_dirs
std::vector< path > m_dirs
the dir container
Definition: DirSearchPath.h:78
std::list
STL class.
std::vector< path >
DirSearchPath::eqPath::operator()
bool operator()(const path &p) const
Definition: DirSearchPath.h:62
DirSearchPath::eqPath::m_ref
path m_ref
Definition: DirSearchPath.h:65
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
DirSearchPath::DirSearchPath
DirSearchPath()
Definition: DirSearchPath.h:24