libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
mzcborcopyreplacebase.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/core/processing/cbor/mzcbor/copyreplace/mzcborreaderbase.h
3 * \date 2/10/2026
4 * \author Olivier Langella
5 * \brief read mzcbor stream or file, process it and write processed mzcbor output
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2026 Olivier Langella <Olivier.Langella@cnrs.fr>.
10 *
11 * This file is part of PAPPSOms-tools.
12 *
13 * PAPPSOms-tools is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms-tools is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27
28
29#pragma once
35namespace pappso
36{
37namespace cbor
38{
39namespace mzcbor
40{
41/**
42 * @brief base class to transform mzCBOR stream in a new mzCBOR output stream
43 *
44 * ensures stream read on regular file or any readable device
45 */
47{
48 public:
49 /**
50 * Default constructor
51 */
52 MzcborCopyReplaceBase(CborStreamWriter *cbor_output_p, const QString &operation);
53
54 /**
55 * Destructor
56 */
57 virtual ~MzcborCopyReplaceBase();
58
59 /**
60 * @brief read mzCBOR file
61 * @param cborp file pointer
62 * @param monitor monitor read progress and messages
63 */
64 virtual void readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor);
65
66
67 /**
68 * @brief read mzCBOR from any device (memory buffer or else)
69 * @param cborp device pointer
70 * @param monitor monitor read progress and messages
71 */
72 virtual void readCbor(QIODevice *cborp, pappso::UiMonitorInterface &monitor);
73
74 virtual void close();
75
76
77 protected:
82
83 virtual void processQcborSpectrum(SpectrumTube &spectrum_tube, QcborSpectrum &cbor_spectrum);
84
85 protected:
86 bool m_stopParsing = false;
88 QString m_operation;
89
90 private:
91 bool m_isMzcbor = false;
92 QString m_uuid;
93};
94} // namespace mzcbor
95} // namespace cbor
96} // namespace pappso
overrides QCborStreamWriter base class to provide convenient functions
MzcborCopyReplaceBase(CborStreamWriter *cbor_output_p, const QString &operation)
virtual void close()
convenient function to clean pointer before leaving
void readSpectrumList(pappso::UiMonitorInterface &monitor)
virtual void processQcborSpectrum(SpectrumTube &spectrum_tube, QcborSpectrum &cbor_spectrum)
void readRoot(pappso::UiMonitorInterface &monitor)
void readRun(pappso::UiMonitorInterface &monitor)
virtual void readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor)
read mzCBOR file
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
Low level CBOR map to store an mzCBOR Spectrum object.
buffer to store a whole spectrum list