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;
virtual void read(const std::string &filename, const std::string &head, std::vector< TraDataPtr > &results) const
fill in a vector of TraData structures; provides support for multi-run input files ...
virtual void read(const std::string &filename, const std::string &head, std::vector< TraDataPtr > &results) const
fill in a vector of TraData structures; provides support for multi-run input files ...
virtual void read(const std::string &uri, ProteomeData &result) const
delegates to first child that identifies
virtual std::string identify(const std::string &filename, const std::string &head) const
return file type iff Reader recognizes the file, else empty;
virtual std::string identify(const std::string &filename, const std::string &head) const
return file type iff Reader recognizes the file, else empty;
virtual const char * getType() const
fill in a vector of MSData.Id values; provides support for multi-run input files
bool accept(const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr) const
return true iff Reader recognizes the file as one it should handle
interface for file readers
interface for file readers
boost::shared_ptr< TraData > TraDataPtr
virtual void read(const std::string &filename, const std::string &head, TraData &result, int runIndex=0) const
fill in the TraData structure from the first (or only) sample
int main(int argc, char *argv[])
#define TEST_PROLOG_EX(argc, argv, suffix)
PWIZ_API_DECL void read(std::istream &is, CV &cv)
virtual void read(const std::string &filename, const std::string &head, TraData &result, int runIndex=0) const
fill in the TraData structure from the first (or only) sample
Reader container (composite pattern).
reader_type * get()
returns pointer to Reader of the specified type
boost::shared_ptr< Reader > ReaderPtr
const char * getType() const
fill in a vector of MSData.Id values; provides support for multi-run input files