ProteoWizard
Serializer_Text.hpp
Go to the documentation of this file.
1//
2// $Id$
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_TEXT_HPP_
25#define _SERIALIZER_TEXT_HPP_
26
30
31namespace pwiz {
32namespace identdata {
33
34/// \class Serializer_Text
35///
36/// Serializer_Text reads in and writes out an id file in tab format.
37///
39{
40public:
41 /// List of fields available.
43 {
44 None=0,
45 Scan=1,
46 Rt=2,
47 Mz=3,
48 Charge=4,
49 Score=5,
50 ScoreType=6,
53 ProteinDescription=9,
54 Last=ProteinDescription
55 };
56
57 static const std::string* getIdFieldNames();
58
59 struct PWIZ_API_DECL Config ///< Controls the format of the text file.
60 {
61 bool headers;
62 std::vector<IdField> fields;
64
65 std::string recordDelim;
66 std::string fieldDelim;
67
69 Config(const Config& config);
70 };
71
72 /// Constructor with Config
73 Serializer_Text(const Config& config = Config());
74
75 /// writes IdentData object to ostream as a text table
76 void write(std::ostream& os, const IdentData& mzid,
77 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0) const;
78
79 /// read in IdentData object from a delimited text fromat.
80 void read(boost::shared_ptr<std::istream> is, IdentData& mzid) const;
81
82 private:
83 class Impl;
84 boost::shared_ptr<Impl> impl_;
87};
88
89
90} // namespace identdata
91} // namespace pwiz
92
93#endif // _SERIALIZER_TEXT_HPP_
#define PWIZ_API_DECL
Definition Export.hpp:32
Serializer_Text reads in and writes out an id file in tab format.
Serializer_Text(Serializer_Text &)
IdField
List of fields available.
void write(std::ostream &os, const IdentData &mzid, const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0) const
writes IdentData object to ostream as a text table
static const std::string * getIdFieldNames()
Serializer_Text(const Config &config=Config())
Constructor with Config.
Serializer_Text & operator=(Serializer_Text &)
void read(boost::shared_ptr< std::istream > is, IdentData &mzid) const
read in IdentData object from a delimited text fromat.
boost::shared_ptr< Impl > impl_
handles registration of IterationListeners and broadcast of update messages
Implementation of the MzIdentMLType from the mzIdentML schema.
Implementation of PeptideType from the mzIdentML schema.
< Controls the format of the text file.