ProteoWizard
Classes | Public Member Functions | Public Attributes | List of all members
Reader1 Class Reference
Inheritance diagram for Reader1:
pwiz::tradata::Reader

Classes

struct  Config
 
struct  ReaderConfig
 

Public Member Functions

virtual std::string identify (const std::string &filename, const std::string &head) const
 return file type iff Reader recognizes the file, else empty; More...
 
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 More...
 
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 More...
 
virtual const char * getType () const
 fill in a vector of MSData.Id values; provides support for multi-run input files More...
 
virtual std::string identify (const std::string &filename, const std::string &head) const
 return file type iff Reader recognizes the file, else empty; More...
 
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
 
virtual const char * getType () const
 fill in a vector of MSData.Id values; provides support for multi-run input files More...
 
virtual std::string identify (const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr) const
 
virtual void read (const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr, ProteomeData &result) const
 
virtual const char * getType () const
 fill in a vector of MSData.Id values; provides support for multi-run input files More...
 
virtual std::string identify (const std::string &filename, const std::string &head) const
 return file type iff Reader recognizes the file, else empty; More...
 
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 More...
 
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 More...
 
virtual const char * getType () const
 fill in a vector of MSData.Id values; provides support for multi-run input files More...
 
- Public Member Functions inherited from pwiz::tradata::Reader
bool accept (const std::string &filename, const std::string &head) const
 return true iff Reader recognizes the file as one it should handle More...
 
virtual ~Reader ()
 

Public Attributes

Config config
 
ReaderConfig readerConfig
 

Detailed Description

Definition at line 37 of file ReaderTest.cpp.

Member Function Documentation

◆ identify() [1/4]

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

return file type iff Reader recognizes the file, else empty;

note: for formats requiring a 3rd party DLL identify() should return true if it recognized the format, even though reading may fail if the 3rd party DLL isn't actually present Reader may filter based on filename and/or head of the file

Implements pwiz::tradata::Reader.

Definition at line 49 of file ReaderTest.cpp.

50  {
51  bool result = (filename == "1");
52  if (os_) *os_ << "Reader1::identify(): " << boolalpha << result << endl;
53  return result ? filename : std::string("");
54  }

References os_.

◆ read() [1/7]

virtual void Reader1::read ( const std::string &  filename,
const std::string &  head,
TraData result,
int  runIndex = 0 
) const
inlinevirtual

fill in the TraData structure from the first (or only) sample

Implements pwiz::tradata::Reader.

Definition at line 56 of file ReaderTest.cpp.

60  {
61  if (os_) *os_ << "Reader1::read()\n";
62  config.done = true;
63  }

References Reader1::Config::done, and os_.

◆ read() [2/7]

virtual void Reader1::read ( const std::string &  filename,
const std::string &  head,
std::vector< TraDataPtr > &  results 
) const
inlinevirtual

fill in a vector of TraData structures; provides support for multi-run input files

Implements pwiz::tradata::Reader.

Definition at line 65 of file ReaderTest.cpp.

68  {
69  results.push_back(TraDataPtr(new TraData));
70  read(filename, head, *results.back());
71  }

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

◆ getType() [1/4]

virtual const char* Reader1::getType ( ) const
inlinevirtual

fill in a vector of MSData.Id values; provides support for multi-run input files

Implements pwiz::tradata::Reader.

Definition at line 73 of file ReaderTest.cpp.

73 {return "Reader1";} // satisfy inheritance

◆ identify() [2/4]

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

return file type iff Reader recognizes the file, else empty;

note: for formats requiring a 3rd party DLL identify() should return true if it recognized the format, even though reading may fail if the 3rd party DLL isn't actually present Reader may filter based on filename and/or head of the file

Implements pwiz::tradata::Reader.

Definition at line 55 of file ReaderTest.cpp.

56  {
57  bool result = (filename == "1");
58  if (os_) *os_ << "Reader1::identify(): " << boolalpha << result << endl;
59  return std::string (result?filename:std::string(""));
60  }

References os_.

◆ read() [3/7]

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

Definition at line 62 of file ReaderTest.cpp.

67  {
68  if (os_) *os_ << "Reader1::read()\n";
69  readerConfig.done = true;
70  }

References Reader1::ReaderConfig::done, and os_.

◆ read() [4/7]

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

Definition at line 72 of file ReaderTest.cpp.

76  {
77  results.push_back(MSDataPtr(new MSData));
78  read(filename, head, *results.back(), 0, config);
79  }

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

◆ getType() [2/4]

virtual const char* Reader1::getType ( ) const
inlinevirtual

fill in a vector of MSData.Id values; provides support for multi-run input files

Implements pwiz::tradata::Reader.

Definition at line 81 of file ReaderTest.cpp.

81 {return "Reader1";} // satisfy inheritance

◆ identify() [3/4]

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

Definition at line 48 of file ReaderTest.cpp.

49  {
50  bool result = (uri == "1");
51  if (os_) *os_ << "Reader1::identify(): " << boolalpha << result << endl;
52  return std::string (result?uri:std::string(""));
53  }

References os_.

◆ read() [5/7]

virtual void Reader1::read ( const std::string &  uri,
boost::shared_ptr< std::istream >  uriStreamPtr,
ProteomeData result 
) const
inlinevirtual

Definition at line 55 of file ReaderTest.cpp.

58  {
59  if (os_) *os_ << "Reader1::read()\n";
60  config.done = true;
61  }

References os_.

◆ getType() [3/4]

virtual const char* Reader1::getType ( ) const
inlinevirtual

fill in a vector of MSData.Id values; provides support for multi-run input files

Implements pwiz::tradata::Reader.

Definition at line 63 of file ReaderTest.cpp.

63 {return "Reader1";} // satisfy inheritance

◆ identify() [4/4]

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

return file type iff Reader recognizes the file, else empty;

note: for formats requiring a 3rd party DLL identify() should return true if it recognized the format, even though reading may fail if the 3rd party DLL isn't actually present Reader may filter based on filename and/or head of the file

Implements pwiz::tradata::Reader.

Definition at line 49 of file ReaderTest.cpp.

50  {
51  bool result = (filename == "1");
52  if (os_) *os_ << "Reader1::identify(): " << boolalpha << result << endl;
53  return result ? filename : std::string("");
54  }

References os_.

◆ read() [6/7]

virtual void Reader1::read ( const std::string &  filename,
const std::string &  head,
TraData result,
int  runIndex = 0 
) const
inlinevirtual

fill in the TraData structure from the first (or only) sample

Implements pwiz::tradata::Reader.

Definition at line 56 of file ReaderTest.cpp.

60  {
61  if (os_) *os_ << "Reader1::read()\n";
62  config.done = true;
63  }

References os_.

◆ read() [7/7]

virtual void Reader1::read ( const std::string &  filename,
const std::string &  head,
std::vector< TraDataPtr > &  results 
) const
inlinevirtual

fill in a vector of TraData structures; provides support for multi-run input files

Implements pwiz::tradata::Reader.

Definition at line 65 of file ReaderTest.cpp.

68  {
69  results.push_back(TraDataPtr(new TraData));
70  read(filename, head, *results.back());
71  }

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

◆ getType() [4/4]

virtual const char* Reader1::getType ( ) const
inlinevirtual

fill in a vector of MSData.Id values; provides support for multi-run input files

Implements pwiz::tradata::Reader.

Definition at line 73 of file ReaderTest.cpp.

73 {return "Reader1";} // satisfy inheritance

Member Data Documentation

◆ config

Config Reader1::config

Definition at line 47 of file ReaderTest.cpp.

Referenced by testGet(), and testRead().

◆ readerConfig

ReaderConfig Reader1::readerConfig

Definition at line 53 of file ReaderTest.cpp.

Referenced by testGet(), and testRead().


The documentation for this class was generated from the following file:
pwiz::tradata::TraDataPtr
boost::shared_ptr< TraData > TraDataPtr
Definition: TraData.hpp:406
pwiz::tradata::TraData
Definition: TraData.hpp:350
pwiz::msdata::MSDataPtr
boost::shared_ptr< MSData > MSDataPtr
Definition: MSData.hpp:913
Reader1::config
Config config
Definition: ReaderTest.cpp:47
Reader1::Config::done
bool done
Definition: ReaderTest.cpp:43
os_
ostream * os_
Definition: ReaderTest.cpp:34
Reader1::readerConfig
ReaderConfig readerConfig
Definition: ReaderTest.cpp:53
Reader1::ReaderConfig::done
bool done
Definition: ReaderTest.cpp:49
Reader1::read
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
Definition: ReaderTest.cpp:56
pwiz::msdata::MSData
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:849