libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
cvparam.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/core/processing/cbor/mzcbor/cvparam.h
3 * \date 23/11/2025
4 * \author Olivier Langella
5 * \brief PSI cvParam object for mzML/mzCBOR
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.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
30#include <QString>
31#include <QXmlStreamWriter>
32#include <QCborStreamReader>
33#include <qjsonobject.h>
36
37namespace pappso
38{
39namespace cbor
40{
41namespace mzcbor
42{
43/**
44 * @todo write docs
45 */
47{
48 void fromCbor(CborStreamReader &reader);
49 void toCbor(CborStreamWriter &writer);
50
51 /** @brief reads the XML attributes of the cvParam element
52 * Inside the cvParam XML element, reads the attributes and go to next XML element
53 * @param reader XML stream reader
54 */
55 void fromMzml(QXmlStreamReader &reader);
56 void toMzml(QXmlStreamWriter &writer);
57
58
59 /** @brief write the structure to a JSON object
60 * @result QJsonObject
61 */
62 QJsonObject toJsonObject() const;
63
64
65 void xmlValueToCbor(CborStreamWriter &writer, const QStringView &value_str);
66
67 void setValue(const QString &value_str);
68
69 std::uint8_t getExpectedUint8() const;
70 double getExpectedDouble() const;
71 qint64 getExpectedQint64() const;
72
73 QString cvRef;
74 QString accession;
75 double valueDouble = nan("");
76 qint64 valueInt = std::numeric_limits<qint64>::max();
77 QString valueStr;
78 QString name;
80 QString unitName;
81 QString unitCvRef;
82
83 QCborStreamReader::Type cborType = QCborStreamReader::Type::Invalid;
84};
85} // namespace mzcbor
86} // namespace cbor
87} // namespace pappso
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
overrides QCborStreamWriter base class to provide convenient functions
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
void fromCbor(CborStreamReader &reader)
Definition cvparam.cpp:36
QJsonObject toJsonObject() const
write the structure to a JSON object
Definition cvparam.cpp:190
QCborStreamReader::Type cborType
Definition cvparam.h:83
void setValue(const QString &value_str)
Definition cvparam.cpp:224
void xmlValueToCbor(CborStreamWriter &writer, const QStringView &value_str)
Definition cvparam.cpp:320
void fromMzml(QXmlStreamReader &reader)
reads the XML attributes of the cvParam element Inside the cvParam XML element, reads the attributes ...
Definition cvparam.cpp:121
void toCbor(CborStreamWriter &writer)
Definition cvparam.cpp:161
qint64 getExpectedQint64() const
Definition cvparam.cpp:287
void toMzml(QXmlStreamWriter &writer)
Definition cvparam.cpp:232
std::uint8_t getExpectedUint8() const
Definition cvparam.cpp:271
double getExpectedDouble() const
Definition cvparam.cpp:303