31{
32 void SampleLocal ::
33 testInvariant () const
34 {
35 for (FilesIter
file = m_files.begin(),
36 end = m_files.end();
file != end; ++
file)
37 {
40 }
41 }
42
43
44
45 SampleLocal ::
46 SampleLocal ()
47 : Sample ("unnamed")
48 {
50 }
51
52
53
54 SampleLocal ::
55 SampleLocal (const std::string& name)
57 {
59 }
60
61
62
63 void SampleLocal ::
64 add (
const std::string&
file)
65 {
68
69 std::string myfile =
file;
70 if (myfile.find (":/") == std::string::npos)
71 {
72 if (myfile[0] != '/')
73 myfile = gSystem->WorkingDirectory() + ("/" + myfile);
74 myfile = "file://" + myfile;
75 }
76 m_files.push_back (myfile);
77 }
78
79
80
81 std::size_t SampleLocal ::
82 getNumFiles () const
83 {
85 return m_files.size();
86 }
87
88
89
90 std::string SampleLocal ::
91 getFileName (
const std::size_t
index)
const
92 {
94
96 return m_files[
index];
97 }
98
99
100
101 SamplePtr SampleLocal ::
102 doMakeLocal () const
103 {
105 return SamplePtr (const_cast<SampleLocal*>(this));
106 }
107
108
109
110 std::vector<std::string> SampleLocal ::
111 doMakeFileList () const
112 {
114
115 std::vector<std::string>
result;
116 for (FilesIter
file = m_files.begin(),
117 end = m_files.end();
file != end; ++
file)
120 }
121
122
123
124 void SampleLocal ::
125 doUpdateLocation (const std::string& from, const std::string& to)
126 {
128 for (FilesMIter
file = m_files.begin(),
129 end = m_files.end();
file != end; ++
file)
130 {
131 if (strncmp (
file->c_str(), from.c_str(), from.size()) == 0)
132 *
file =
to +
"/" +
file->substr (from.size());
133 }
134 }
135}
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_REQUIRE_SOFT(x)
#define RCU_READ_INVARIANT(x)