libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
cborstreamreader.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/cbor/cborstreamwriter.h
3 * \date 08/07/2025
4 * \author Olivier Langella
5 * \brief PAPPSO CBOR stream reader
6 *
7 * QCborStreamReader overloaded with convenient functions
8 */
9
10/*******************************************************************************
11 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
12 *
13 * This file is part of PAPPSOms-tools.
14 *
15 * PAPPSOms-tools is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PAPPSOms-tools is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
27 *
28 ******************************************************************************/
29#pragma once
30
31#include <QCborStreamReader>
32#include <QStringList>
33#include <QCborMap>
34#include <QCborArray>
36
37namespace pappso
38{
39namespace cbor
40{
41/**
42 * @todo write docs
43 */
44class PMSPP_LIB_DECL CborStreamReader : public QCborStreamReader
45{
46 public:
47 /**
48 * Default constructor
49 */
51 CborStreamReader(QIODevice *device);
52
53 /**
54 * Destructor
55 */
56 virtual ~CborStreamReader();
57
58 /** @brief decode the current cbor value as a string the point to the next value
59 * the current value is decoded as a string, beware that using this function, the cbor stream will
60 * point to the next cbor value
61 * @return true if OK
62 */
63 bool decodeString(QString &the_str);
64
65 bool readCborMap(QCborMap &cbor_map);
66 bool readCborArray(QCborArray &cbor_array);
67 bool readArray(std::vector<std::size_t> &int_list);
68 bool readArray(std::vector<double> &double_list);
69 bool readArray(std::vector<int> &positions);
70 bool readArray(QStringList &str_list);
71};
72} // namespace cbor
73} // namespace pappso
bool readCborMap(QCborMap &cbor_map)
bool readCborArray(QCborArray &cbor_array)
bool readArray(std::vector< std::size_t > &int_list)
bool decodeString(QString &the_str)
decode the current cbor value as a string the point to the next value the current value is decoded as...
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39