ProteoWizard
Public Member Functions | Public Attributes | List of all members
TestReader Class Reference
Inheritance diagram for TestReader:
pwiz::proteome::Reader pwiz::proteome::Reader

Public Member Functions

 TestReader ()
 
virtual std::string identify (const std::string &filename, const std::string &head) const
 
virtual void read (const std::string &filename, const std::string &head, MSData &result, int runIndex=0, const Config &config=Config()) const
 
virtual void read (const std::string &filename, const std::string &head, std::vector< MSDataPtr > &results, const Config &config=Config()) const
 
const char * getType () const
 
 TestReader ()
 
virtual std::string identify (const std::string &uri, shared_ptr< istream > uriStreamPtr) const
 
virtual void read (const std::string &uri, shared_ptr< istream > uriStreamPtr, ProteomeData &pd) const
 
const char * getType () const
 
- Public Member Functions inherited from pwiz::proteome::Reader
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 More...
 
virtual std::string identify (const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr) const =0
 return file type iff Reader recognizes the file, else empty; More...
 
virtual void read (const std::string &uri, ProteomeData &result) const
 fill in the ProteomeData structure from a new URI stream More...
 
virtual void read (const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr, ProteomeData &result) const =0
 fill in the ProteomeData structure from a shared URI stream More...
 
virtual ~Reader ()
 

Public Attributes

int count
 

Detailed Description

Definition at line 286 of file MSDataFileTest.cpp.

Constructor & Destructor Documentation

§ TestReader() [1/2]

TestReader::TestReader ( )
inline

Definition at line 290 of file MSDataFileTest.cpp.

290 : count(0) {}

§ TestReader() [2/2]

TestReader::TestReader ( )
inline

Definition at line 142 of file ProteomeDataFileTest.cpp.

142 : count(0) {}

Member Function Documentation

§ identify() [1/2]

virtual std::string TestReader::identify ( const std::string &  filename,
const std::string &  head 
) const
inlinevirtual

Definition at line 292 of file MSDataFileTest.cpp.

References rawHeader_.

293  {
294  if (filename.size()<=4 || filename.substr(filename.size()-4)!=".RAW")
295  return std::string("");
296 
297  for (size_t i=0; i<sizeof(rawHeader_); i++)
298  if (head[i] != rawHeader_[i])
299  return std::string("");
300 
301  count++;
302  return filename;
303  }
const char rawHeader_[]

§ read() [1/3]

virtual void TestReader::read ( const std::string &  filename,
const std::string &  head,
MSData result,
int  runIndex = 0,
const Config &  config = Config() 
) const
inlinevirtual

Definition at line 305 of file MSDataFileTest.cpp.

307  {
308  count++;
309  }

§ read() [2/3]

virtual void TestReader::read ( const std::string &  filename,
const std::string &  head,
std::vector< MSDataPtr > &  results,
const Config &  config = Config() 
) const
inlinevirtual

Definition at line 311 of file MSDataFileTest.cpp.

References pwiz::identdata::IO::read().

315  {
316  results.push_back(MSDataPtr(new MSData));
317  read(filename, head, *results.back(), 0, config);
318  }
boost::shared_ptr< MSData > MSDataPtr
Definition: MSData.hpp:909
virtual void read(const std::string &filename, const std::string &head, MSData &result, int runIndex=0, const Config &config=Config()) const
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845

§ getType() [1/2]

const char* TestReader::getType ( ) const
inlinevirtual

Implements pwiz::proteome::Reader.

Definition at line 320 of file MSDataFileTest.cpp.

320 {return "testReader";} // satisfy inheritance

§ identify() [2/2]

virtual std::string TestReader::identify ( const std::string &  uri,
shared_ptr< istream >  uriStreamPtr 
) const
inlinevirtual

Definition at line 144 of file ProteomeDataFileTest.cpp.

145  {
146  ++count;
147 
148  if (!bal::iends_with(uri, ".fasta"))
149  return "";
150 
151  string buf;
152  getline(*uriStreamPtr, buf);
153  if (buf[0] != '>')
154  return "";
155 
156  return getType();
157  }
const char * getType() const

§ read() [3/3]

virtual void TestReader::read ( const std::string &  uri,
shared_ptr< istream >  uriStreamPtr,
ProteomeData pd 
) const
inlinevirtual

Definition at line 159 of file ProteomeDataFileTest.cpp.

162  {
163  ++count;
164  }

§ getType() [2/2]

const char* TestReader::getType ( ) const
inlinevirtual

Implements pwiz::proteome::Reader.

Definition at line 166 of file ProteomeDataFileTest.cpp.

166 {return "testReader";} // satisfy inheritance

Member Data Documentation

§ count

int TestReader::count
mutable

Definition at line 322 of file MSDataFileTest.cpp.

Referenced by testReader().


The documentation for this class was generated from the following files: