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 220 of file MSDataFileTest.cpp.

Constructor & Destructor Documentation

TestReader::TestReader ( )
inline

Definition at line 224 of file MSDataFileTest.cpp.

224 : count(0) {}
TestReader::TestReader ( )
inline

Definition at line 142 of file ProteomeDataFileTest.cpp.

142 : count(0) {}

Member Function Documentation

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

Definition at line 226 of file MSDataFileTest.cpp.

References rawHeader_.

227  {
228  if (filename.size()<=4 || filename.substr(filename.size()-4)!=".RAW")
229  return std::string("");
230 
231  for (size_t i=0; i<sizeof(rawHeader_); i++)
232  if (head[i] != rawHeader_[i])
233  return std::string("");
234 
235  count++;
236  return filename;
237  }
const char rawHeader_[]
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 239 of file MSDataFileTest.cpp.

241  {
242  count++;
243  }
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 245 of file MSDataFileTest.cpp.

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

249  {
250  results.push_back(MSDataPtr(new MSData));
251  read(filename, head, *results.back(), 0, config);
252  }
virtual void read(const std::string &filename, const std::string &head, MSData &result, int runIndex=0, const Config &config=Config()) const
boost::shared_ptr< MSData > MSDataPtr
Definition: MSData.hpp:914
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:850
const char* TestReader::getType ( ) const
inlinevirtual

Implements pwiz::proteome::Reader.

Definition at line 254 of file MSDataFileTest.cpp.

254 {return "testReader";} // satisfy inheritance
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
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  }
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

int TestReader::count
mutable

Definition at line 256 of file MSDataFileTest.cpp.

Referenced by testReader().


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