rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
RivetPaths.hh
1 // -*- C++ -*-
2 #ifndef RIVET_RivetPaths_HH
3 #define RIVET_RivetPaths_HH
4 #include <string>
5 #include <vector>
6 #include <unistd.h>
7 
8 namespace Rivet {
9 
10 
12  inline bool fileexists(const std::string& path) {
13  return (access(path.c_str(), R_OK) == 0);
14  }
15 
16 
18 
19 
21  std::string getLibPath();
22 
24  std::string getDataPath();
25 
27  std::string getRivetDataPath();
28 
30 
31 
33 
34 
36  std::vector<std::string> getAnalysisLibPaths();
37 
39  void setAnalysisLibPaths(const std::vector<std::string>& paths);
40 
42  void addAnalysisLibPath(const std::string& extrapath);
43 
46  std::string findAnalysisLibFile(const std::string& filename);
47 
49 
50 
52 
53 
55  std::vector<std::string> getAnalysisDataPaths();
56 
58  void setAnalysisDataPaths(const std::vector<std::string>& paths);
59 
61  void addAnalysisDataPath(const std::string& extrapath);
62 
65  std::string findAnalysisDataFile(const std::string& filename,
66  const std::vector<std::string>& pathprepend=std::vector<std::string>(),
67  const std::vector<std::string>& pathappend=std::vector<std::string>());
68 
69 
71  std::vector<std::string> getAnalysisRefPaths();
72 
75  std::string findAnalysisRefFile(const std::string& filename,
76  const std::vector<std::string>& pathprepend=std::vector<std::string>(),
77  const std::vector<std::string>& pathappend=std::vector<std::string>());
78 
79 
81  std::vector<std::string> getAnalysisInfoPaths();
82 
85  std::string findAnalysisInfoFile(const std::string& filename,
86  const std::vector<std::string>& pathprepend=std::vector<std::string>(),
87  const std::vector<std::string>& pathappend=std::vector<std::string>());
88 
89 
91  std::vector<std::string> getAnalysisPlotPaths();
92 
95  std::string findAnalysisPlotFile(const std::string& filename,
96  const std::vector<std::string>& pathprepend=std::vector<std::string>(),
97  const std::vector<std::string>& pathappend=std::vector<std::string>());
98 
100 
101 
102 }
103 
104 #endif
Definition: ALICE_2010_I880049.cc:13
void setAnalysisDataPaths(const std::vector< std::string > &paths)
Set the Rivet data file search paths.
Definition: RivetPaths.cc:71
std::string findAnalysisLibFile(const std::string &filename)
Find the first file of the given name in the analysis library search dirs.
Definition: RivetPaths.cc:65
std::string findAnalysisDataFile(const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
Find the first file of the given name in the general data file search dirs.
Definition: RivetPaths.cc:97
std::vector< std::string > getAnalysisInfoPaths()
Get Rivet analysis info metadata search paths.
Definition: RivetPaths.cc:122
bool fileexists(const std::string &path)
Convenience function for determining if a filesystem path exists.
Definition: RivetPaths.hh:12
std::string findAnalysisRefFile(const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
Find the first file of the given name in the ref data file search dirs.
Definition: RivetPaths.cc:115
std::string getRivetDataPath()
Get Rivet data install path.
Definition: RivetPaths.cc:37
std::string getLibPath()
Get library install path.
Definition: RivetPaths.cc:19
std::string getDataPath()
Get data install path.
Definition: RivetPaths.cc:28
void setAnalysisLibPaths(const std::vector< std::string > &paths)
Set the Rivet analysis plugin library search paths.
Definition: RivetPaths.cc:43
std::vector< std::string > getAnalysisPlotPaths()
Get Rivet analysis plot style search paths.
Definition: RivetPaths.cc:140
std::string findAnalysisPlotFile(const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
Find the first file of the given name in the analysis plot file search dirs.
Definition: RivetPaths.cc:151
void addAnalysisDataPath(const std::string &extrapath)
Add a Rivet data file search path.
Definition: RivetPaths.cc:76
std::vector< std::string > getAnalysisRefPaths()
Get Rivet analysis reference data search paths.
Definition: RivetPaths.cc:104
void addAnalysisLibPath(const std::string &extrapath)
Add a Rivet analysis plugin library search path.
Definition: RivetPaths.cc:48
std::string findAnalysisInfoFile(const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
Find the first file of the given name in the analysis info file search dirs.
Definition: RivetPaths.cc:133
std::vector< std::string > getAnalysisLibPaths()
Get Rivet analysis plugin library search paths.
Definition: RivetPaths.cc:54
std::vector< std::string > getAnalysisDataPaths()
Get Rivet analysis reference data search paths.
Definition: RivetPaths.cc:82