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
 
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;
 
virtual void read (const std::string &uri, ProteomeData &result) const
 fill in the ProteomeData structure from a new URI stream
 
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
 
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 198 of file ProteomeDataFileTest.cpp.

198: 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.

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_[]

References count, and 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 }

References count.

Referenced by read().

◆ 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.

315 {
316 results.push_back(MSDataPtr(new MSData));
317 read(filename, head, *results.back(), 0, config);
318 }
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:913
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition MSData.hpp:850

References read().

◆ 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

Referenced by identify().

◆ identify() [2/2]

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

Definition at line 200 of file ProteomeDataFileTest.cpp.

201 {
202 ++count;
203
204 if (!bal::iends_with(uri, ".fasta"))
205 return "";
206
207 string buf;
208 getline(*uriStreamPtr, buf);
209 if (buf[0] != '>')
210 return "";
211
212 return getType();
213 }
const char * getType() const

References count, and getType().

◆ read() [3/3]

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

Definition at line 215 of file ProteomeDataFileTest.cpp.

218 {
219 ++count;
220 }

References count.

◆ getType() [2/2]

const char * TestReader::getType ( ) const
inlinevirtual

Implements pwiz::proteome::Reader.

Definition at line 222 of file ProteomeDataFileTest.cpp.

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

Member Data Documentation

◆ count

int TestReader::count
mutable

Definition at line 322 of file MSDataFileTest.cpp.

Referenced by identify(), identify(), read(), read(), and testReader().


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