Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
filepath_maker.h
Go to the documentation of this file.
1
#ifndef cetlib_filepath_maker_h
2
#define cetlib_filepath_maker_h
3
4
// ======================================================================
5
//
6
// filepath_maker: A family of related policies governing the translation
7
// of a filename into a fully-qualified filepath
8
//
9
// The semantics of each of the policies are as follows:
10
//
11
// filepath_maker: No lookup at all.
12
//
13
// filepath_lookup: Only lookup permitted.
14
15
// filepath_lookup_nonabsolute: Absolute paths are allowed, but lookup
16
// occurs for non-absolute paths.
17
//
18
// filepath_lookup_after1: No lookup for the first file, and only
19
// lookup for all subsequent files.
20
//
21
// filepath_first_absolute_or_lookup_with_dot: The first file can be
22
// an absolute path, a path relative to '.', or a path that can be
23
// looked up; all subsequent files must be looked up.
24
//
25
// ======================================================================
26
27
#include "
cetlib/search_path.h
"
28
#include <string>
29
30
namespace
cet
{
31
class
filepath_maker;
32
class
filepath_lookup;
33
class
filepath_lookup_nonabsolute;
34
class
filepath_lookup_after1;
35
class
filepath_first_absolute_or_lookup_with_dot;
36
}
37
38
// ----------------------------------------------------------------------
39
40
class
cet::filepath_maker
{
41
public
:
42
virtual
std::string
operator()
(
std::string
const
&
filename
);
43
44
virtual
~filepath_maker
() noexcept =
default
;
45
46
};
// filepath_maker
47
48
// ----------------------------------------------------------------------
49
50
class
cet::filepath_lookup
:
public
cet::filepath_maker
{
51
public
:
52
filepath_lookup
(
std::string
paths
);
53
54
std::string
operator()
(
std::string
const
&
filename
)
override
;
55
56
private
:
57
cet::search_path
paths
;
58
59
};
// filepath_lookup
60
61
// ----------------------------------------------------------------------
62
63
class
cet::filepath_lookup_nonabsolute
:
public
cet::filepath_maker
{
64
public
:
65
filepath_lookup_nonabsolute
(
std::string
paths
);
66
67
std::string
operator()
(
std::string
const
&
filename
)
override
;
68
69
private
:
70
cet::search_path
paths
;
71
72
};
// filepath_lookup_nonabsolute
73
74
// ----------------------------------------------------------------------
75
76
class
cet::filepath_lookup_after1
:
public
cet::filepath_maker
{
77
public
:
78
filepath_lookup_after1
(
std::string
paths
);
79
80
std::string
operator()
(
std::string
const
&
filename
)
override
;
81
82
void
reset();
83
84
private
:
85
bool
after1{
false
};
86
cet::search_path
paths
;
87
88
};
// filepath_lookup_after1
89
90
// ----------------------------------------------------------------------
91
92
class
cet::filepath_first_absolute_or_lookup_with_dot
93
:
public
cet::filepath_maker
{
94
public
:
95
// The provided string must be the *value* of the environment
96
// variable, *not* its name.
97
filepath_first_absolute_or_lookup_with_dot
(
std::string
const
&
paths
);
98
std::string
operator()
(
std::string
const
&
filename
)
override
;
99
void
reset();
100
101
private
:
102
bool
first{
true
};
103
cet::search_path
first_paths
;
104
cet::search_path
after_paths
;
105
};
// filepath_first_absolute_or_lookup_with_dot
106
107
// ======================================================================
108
109
#endif
/* cetlib_filepath_maker_h */
110
111
// Local Variables:
112
// mode: c++
113
// End:
cet::filepath_lookup_after1
Definition:
filepath_maker.h:76
TB_WatchdogFx.paths
paths
Definition:
TB_WatchdogFx.py:304
cet::filepath_first_absolute_or_lookup_with_dot
Definition:
filepath_maker.h:92
cet::filepath_lookup_nonabsolute::paths
cet::search_path paths
Definition:
filepath_maker.h:70
shutoffs.filename
string filename
Definition:
shutoffs.py:106
cet::filepath_lookup::paths
cet::search_path paths
Definition:
filepath_maker.h:57
cet::filepath_maker
Definition:
filepath_maker.h:40
cet
Definition:
get_LibraryInfoCollection.h:10
cet::filepath_lookup
Definition:
filepath_maker.h:50
cet::filepath_first_absolute_or_lookup_with_dot::after_paths
cet::search_path after_paths
Definition:
filepath_maker.h:104
cet::filepath_maker::~filepath_maker
virtual ~filepath_maker() noexcept=default
cet::filepath_first_absolute_or_lookup_with_dot::first_paths
cet::search_path first_paths
Definition:
filepath_maker.h:103
search_path.h
cet::filepath_maker::operator()
virtual std::string operator()(std::string const &filename)
cet::filepath_lookup_after1::paths
cet::search_path paths
Definition:
filepath_maker.h:86
cet::search_path
Definition:
search_path.h:37
cet::filepath_lookup_nonabsolute
Definition:
filepath_maker.h:63
string
enum BeamMode string
Generated on Thu Feb 25 2021 14:14:46 for NOvA by
1.8.11