29 using namespace pwiz::util;
31 using namespace pwiz::tradata;
49 virtual std::string identify(
const std::string& filename,
const std::string& head)
const
51 bool result = (filename ==
"1");
52 if (
os_) *
os_ <<
"Reader1::identify(): " << boolalpha << result << endl;
53 return result ? filename : std::string(
"");
56 virtual void read(
const std::string& filename,
57 const std::string& head,
59 int runIndex = 0)
const
61 if (
os_) *
os_ <<
"Reader1::read()\n";
65 virtual void read(
const std::string& filename,
66 const std::string& head,
67 std::vector<TraDataPtr>& results)
const
70 read(filename, head, *results.back());
73 virtual const char *
getType()
const {
return "Reader1";}
89 virtual std::string identify(
const std::string& filename,
const std::string& head)
const
91 bool result = (filename ==
"2");
92 if (
os_) *
os_ <<
"Reader2::identify(): " << boolalpha << result << endl;
93 return result ? filename : std::string(
"");
96 virtual void read(
const std::string& filename,
97 const std::string& head,
99 int runIndex = 0)
const
101 if (
os_) *
os_ <<
"Reader2::read()\n";
105 virtual void read(
const std::string& filename,
106 const std::string& head,
107 std::vector<TraDataPtr>& results)
const
110 read(filename, head, *results.back());
113 const char *
getType()
const {
return "Reader2";}
119 if (
os_) *
os_ <<
"testGet()\n";
139 if (
os_) *
os_ <<
"testAccept()\n";
145 if (
os_) *
os_ <<
"accept 1:\n";
147 if (
os_) *
os_ <<
"accept 2:\n";
149 if (
os_) *
os_ <<
"accept 3:\n";
158 if (
os_) *
os_ <<
"testRead()\n";
171 if (readers.
accept(
"1",
"head"))
172 readers.
read(
"1",
"head", td);
177 if (readers.
accept(
"2",
"head"))
178 readers.
read(
"2",
"head", td);
194 int main(
int argc,
char* argv[])
200 if (argc==2 && !strcmp(argv[1],
"-v"))
os_ = &cout;