23{
24 void SampleLocal ::
25 testInvariant () const
26 {
27 for (FilesIter
file = m_files.begin(),
28 end = m_files.end();
file != end; ++
file)
29 {
32 }
33 }
34
35
36
37 SampleLocal ::
38 SampleLocal ()
39 : Sample ("unnamed")
40 {
42 }
43
44
45
46 SampleLocal ::
47 SampleLocal (const std::string& name)
49 {
51 }
52
53
54
55 void SampleLocal ::
56 add (
const std::string&
file)
57 {
60
61 std::string myfile =
file;
62 if (myfile.find (":/") == std::string::npos)
63 {
64 if (myfile[0] != '/')
65 myfile = gSystem->WorkingDirectory() + ("/" + myfile);
66 myfile = "file://" + myfile;
67 }
68 m_files.push_back (myfile);
69 }
70
71
72
73 std::size_t SampleLocal ::
74 getNumFiles () const
75 {
77 return m_files.size();
78 }
79
80
81
82 std::string SampleLocal ::
83 getFileName (
const std::size_t
index)
const
84 {
86
88 return m_files[
index];
89 }
90
91
92
93 std::unique_ptr<SampleLocal> SampleLocal ::
94 doMakeLocal () const
95 {
97 return std::make_unique<SampleLocal>(*this);
98 }
99
100
101
102 std::vector<std::string> SampleLocal ::
103 doMakeFileList () const
104 {
106
107 std::vector<std::string>
result;
108 for (FilesIter
file = m_files.begin(),
109 end = m_files.end();
file != end; ++
file)
112 }
113
114
115
116 void SampleLocal ::
117 doUpdateLocation (const std::string& from, const std::string& to)
118 {
120 for (FilesMIter
file = m_files.begin(),
121 end = m_files.end();
file != end; ++
file)
122 {
123 if (strncmp (
file->c_str(), from.c_str(), from.size()) == 0)
124 *
file =
to +
"/" +
file->substr (from.size());
125 }
126 }
127}
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_REQUIRE_SOFT(x)
#define RCU_READ_INVARIANT(x)