libpappsomspp
Library for mass spectrometry
xmlstreamreaderinterface.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/processing/xml/xmlstreamreaderinterface.h
3  * \date 12/11/2021
4  * \author Olivier Langella
5  * \brief common interface to read all XML streams containing convenient
6  * functions
7  */
8 
9 /*******************************************************************************
10  * Copyright (c) 2021 Olivier Langella <Olivier.Langella@u-psud.fr>.
11  *
12  * This file is part of PAPPSOms-tools.
13  *
14  * PAPPSOms-tools is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * PAPPSOms-tools is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
26  *
27  ******************************************************************************/
28 #pragma once
29 
30 #include <QIODevice>
31 #include <QXmlStreamReader>
32 #include <QXmlStreamWriter>
33 #include "../../exportinmportconfig.h"
34 
35 namespace pappso
36 {
37 /**
38  * @brief convenient xml reader helper
39  */
41 {
42  public:
43  /**
44  * Default constructor
45  */
47 
48  /**
49  * Destructor
50  */
51  virtual ~XmlStreamReaderInterface();
52 
53 
54  virtual bool readFile(const QString &fileName);
55 
56  bool read(QIODevice *device);
57  bool read(const QString &xml_content);
58 
59 
60  QString errorString() const;
61 
62  protected:
63  virtual void readStream() = 0;
64 
65  void cloneStartElement(QXmlStreamWriter &output) const;
66 
67  void cloneElement(QXmlStreamWriter &output);
68  void cloneNode(QXmlStreamWriter &output);
69 
70  protected:
71  QXmlStreamReader m_qxmlStreamReader;
72 };
73 } // namespace pappso
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39