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 fromQCborMap(const QCborMap &reader);
50 void toCbor(CborStreamWriter &writer);
51
52 /** @brief reads the XML attributes of the cvParam element
53 * Inside the cvParam XML element, reads the attributes and go to next XML element
54 * @param reader XML stream reader
55 */
56 void fromMzml(QXmlStreamReader &reader);
57 void toMzml(QXmlStreamWriter &writer);
58
59
60 /** @brief write the structure to a JSON object
61 * @result QJsonObject
62 */
63 QJsonObject toJsonObject() const;
64
65
66 void xmlValueToCbor(CborStreamWriter &writer, const QStringView &value_str);
67
68 void setValue(const QString &value_str);
69
70 std::uint8_t getExpectedUint8() const;
71 double getExpectedDouble() const;
72 qint64 getExpectedQint64() const;
73
74 QString cvRef;
75 QString accession;
76 double valueDouble = nan("");
77 qint64 valueInt = std::numeric_limits<qint64>::max();
78 QString valueStr;
79 QString name;
81 QString unitName;
82 QString unitCvRef;
83
84 QCborStreamReader::Type cborType = QCborStreamReader::Type::Invalid;
85};
86} // namespace mzcbor
87} // namespace cbor
88} // 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:92
QJsonObject toJsonObject() const
write the structure to a JSON object
Definition cvparam.cpp:246
QCborStreamReader::Type cborType
Definition cvparam.h:84
void setValue(const QString &value_str)
Definition cvparam.cpp:280
void xmlValueToCbor(CborStreamWriter &writer, const QStringView &value_str)
Definition cvparam.cpp:376
void fromQCborMap(const QCborMap &reader)
Definition cvparam.cpp:36
void fromMzml(QXmlStreamReader &reader)
reads the XML attributes of the cvParam element Inside the cvParam XML element, reads the attributes ...
Definition cvparam.cpp:177
void toCbor(CborStreamWriter &writer)
Definition cvparam.cpp:217
qint64 getExpectedQint64() const
Definition cvparam.cpp:343
void toMzml(QXmlStreamWriter &writer)
Definition cvparam.cpp:288
std::uint8_t getExpectedUint8() const
Definition cvparam.cpp:327
double getExpectedDouble() const
Definition cvparam.cpp:359