63 bool accept(
const std::string& filename,
64 const std::string& head)
const
66 return (identify(filename,head).length() != 0);
74 virtual std::string identify(
const std::string& filename,
75 const std::string& head)
const = 0;
78 virtual void read(
const std::string& filename,
79 const std::string& head,
82 const Config& config = Config())
const = 0;
85 virtual void read(
const std::string& filename,
86 const std::string& head,
87 std::vector<MSDataPtr>& results,
88 const Config& config = Config())
const = 0;
91 virtual void readIds(
const std::string& filename,
92 const std::string& head,
93 std::vector<std::string>& dataIds,
94 const Config& config = Config())
const;
97 virtual const char* getType()
const = 0;
107 :
std::runtime_error((
"[ReaderFail] " + error).c_str()),
111 virtual const std::string&
error()
const {
return error_;}
128 public std::vector<ReaderPtr>
133 virtual std::string identify(
const std::string& filename)
const;
136 virtual std::string identify(
const std::string& filename,
137 const std::string& head)
const;
140 virtual void read(
const std::string& filename,
146 virtual void read(
const std::string& filename,
147 const std::string& head,
154 virtual void read(
const std::string& filename,
155 std::vector<MSDataPtr>& results,
160 virtual void read(
const std::string& filename,
161 const std::string& head,
162 std::vector<MSDataPtr>& results,
167 virtual void readIds(
const std::string& filename,
168 std::vector<std::string>& results,
173 virtual void readIds(
const std::string& filename,
174 const std::string& head,
175 std::vector<std::string>& results,
191 template <
typename reader_type>
194 for (iterator it=begin(); it!=end(); ++it)
196 reader_type* p =
dynamic_cast<reader_type*
>(it->get());
204 template <
typename reader_type>
205 const reader_type*
get()
const
207 return const_cast<ReaderList*
>(
this)->get<reader_type>();
210 virtual const char*
getType()
const {
return "ReaderList";}
228 #endif // _READER_HPP_
ReaderFail(const std::string &error)
PWIZ_API_DECL double & operator+=(double &d, const MZTolerance &tolerance)
virtual const char * getType() const
returns a unique string identifying the reader type
Reader container (composite pattern).
bool accept(const std::string &filename, const std::string &head) const
return true iff Reader recognizes the file as one it should handle
boost::shared_ptr< Reader > ReaderPtr
bool acceptZeroLengthSpectra
when true, allows for skipping 0 length checks (and thus skip re-reading data for ABI) ...
PWIZ_API_DECL CVID identifyFileFormat(const ReaderPtr &reader, const std::string &filepath)
tries to identify a filepath using the provided Reader or ReaderList; returns the CVID file format of...
interface for file readers
bool simAsSpectra
when true, sets certain vendor readers to produce SIM/SRM transitions as spectra instead of chromatog...
PWIZ_API_DECL void read(std::istream &is, CV &cv)
PWIZ_API_DECL ReaderList operator+(const ReaderPtr &lhs, const ReaderPtr &rhs)
returns a list containing the lhs and rhs as readers
bool combineIonMobilitySpectra
when true, all drift bins/scans in a frame/block are written in combined form instead of as individua...
virtual const std::string & error() const
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...