ProteoWizard
Serializer_mzid.hpp
Go to the documentation of this file.
1 //
2 // $Id: Serializer_mzid.hpp 2820 2011-06-27 22:51:16Z chambm $
3 //
4 //
5 // Original author: Robert Burke <robert.burke@proteowizard.org>
6 //
7 // Copyright 2007 Spielberg Family Center for Applied Proteomics
8 // Cedars-Sinai Medical Center, Los Angeles, California 90048
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 //
22 
23 
24 #ifndef _SERIALIZER_MZID_HPP_
25 #define _SERIALIZER_MZID_HPP_
26 
28 #include "IdentData.hpp"
30 
31 
32 namespace pwiz {
33 namespace identdata {
34 
35 /// MZIDData <-> mzIdentML stream serialization
37 {
38  public:
39 
40  /// Serializer_mzIdentML configuration
42  {
45 
46  Config() : readSequenceCollection(true), readAnalysisData(true) {}
47  };
48 
49  Serializer_mzIdentML(const Config& config = Config()) : config_(config) {}
50 
51  /// write MZIDData object to ostream as mzIdentML
52  void write(std::ostream& os, const IdentData& mzid,
53  const pwiz::util::IterationListenerRegistry* = 0) const;
54 
55  /// read in MZIDData object from a mzIdentML istream
56  void read(boost::shared_ptr<std::istream> is, IdentData& mzid,
57  const pwiz::util::IterationListenerRegistry* = 0) const;
58 
59  private:
60  const Config config_;
63 };
64 
65 } // namespace pwiz
66 } // namespace identdata
67 
68 #endif // _SERIALIZER_MZID_HPP_