23{
24 void SampleLocal ::
25 testInvariant () const
26 {
27 for (
const auto&
file : m_files)
28 {
31 }
32 }
33
34
35
36 SampleLocal ::
37 SampleLocal ()
38 : Sample ("unnamed")
39 {
41 }
42
43
44
45 SampleLocal ::
46 SampleLocal (const std::string& name)
48 {
50 }
51
52
53
54 void SampleLocal ::
55 add (
const std::string&
file)
56 {
59
60 std::string myfile =
file;
61 if (myfile.find (":/") == std::string::npos)
62 {
63 if (myfile[0] != '/')
64 myfile = gSystem->WorkingDirectory() + ("/" + myfile);
65 myfile = "file://" + myfile;
66 }
67 m_files.push_back (myfile);
68 }
69
70
71
72 std::size_t SampleLocal ::
73 getNumFiles () const
74 {
76 return m_files.size();
77 }
78
79
80
81 std::string SampleLocal ::
82 getFileName (
const std::size_t
index)
const
83 {
85
87 return m_files[
index];
88 }
89
90
91
92 std::unique_ptr<SampleLocal> SampleLocal ::
93 doMakeLocal () const
94 {
96 return std::make_unique<SampleLocal>(*this);
97 }
98
99
100
101 std::vector<std::string> SampleLocal ::
102 doMakeFileList () const
103 {
105
106 std::vector<std::string>
result;
107 for (
const auto&
file : m_files)
110 }
111
112
113
114 void SampleLocal ::
115 doUpdateLocation (const std::string& from, const std::string& to)
116 {
118 for (
auto&
file : m_files)
119 {
120
121
122
123 if (
file.starts_with (from) &&
124 (
file.size() == from.size() ||
file[from.size()] ==
'/'))
125 {
126 std::string rest =
file.substr (from.size());
127 if (!rest.empty() && rest.front() == '/')
128 rest.erase (0, 1);
129 file = rest.empty() ?
to :
to +
"/" + rest;
130 }
131 }
132 }
133}
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_REQUIRE_SOFT(x)
#define RCU_READ_INVARIANT(x)