Loading...
Searching...
No Matches
cvparam.h
Go to the documentation of this file.
/**
* \file pappsomspp/core/processing/cbor/mzcbor/cvparam.h
* \date 23/11/2025
* \author Olivier Langella
* \brief PSI cvParam object for mzML/mzCBOR
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of PAPPSOms-tools.
*
* PAPPSOms-tools is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms-tools is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include <QString>
#include <QXmlStreamWriter>
#include <QCborStreamReader>
#include <qjsonobject.h>
#include "pappsomspp/core/processing/cbor/cborstreamreader.h"
#include "pappsomspp/core/processing/cbor/cborstreamwriter.h"
namespace pappso
{
namespace cbor
{
namespace mzcbor
{
/**
* @todo write docs
*/
struct PMSPP_LIB_DECL CvParam
{
void fromCbor(CborStreamReader &reader);
void toCbor(CborStreamWriter &writer);
/** @brief reads the XML attributes of the cvParam element
* Inside the cvParam XML element, reads the attributes and go to next XML element
* @param reader XML stream reader
*/
void fromMzml(QXmlStreamReader &reader);
void toMzml(QXmlStreamWriter &writer);
/** @brief write the structure to a JSON object
* @result QJsonObject
*/
QJsonObject toJsonObject() const;
void xmlValueToCbor(CborStreamWriter &writer, const QStringView &value_str);
void setValue(const QString &value_str);
std::uint8_t getExpectedUint8() const;
double getExpectedDouble() const;
qint64 getExpectedQint64() const;
QString cvRef;
QString accession;
double valueDouble = nan("");
qint64 valueInt = std::numeric_limits<qint64>::max();
QString valueStr;
QString name;
QString unitAccession;
QString unitName;
QString unitCvRef;
QCborStreamReader::Type cborType = QCborStreamReader::Type::Invalid;
};
} // namespace mzcbor
} // namespace cbor
} // namespace pappso
cborstreamreader.h
cborstreamwriter.h
pappso::cbor::CborStreamReader
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
Definition cborstreamreader.h:46
pappso::cbor::CborStreamWriter
overrides QCborStreamWriter base class to provide convenient functions
Definition cborstreamwriter.h:45
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso::cbor::mzcbor
Definition binarydataarray.h:41
pappso::cbor
Definition cborstreamreader.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::cbor::mzcbor::CvParam
Definition cvparam.h:47
pappso::cbor::mzcbor::CvParam::valueStr
QString valueStr
Definition cvparam.h:77
pappso::cbor::mzcbor::CvParam::fromCbor
void fromCbor(CborStreamReader &reader)
Definition cvparam.cpp:36
pappso::cbor::mzcbor::CvParam::cvRef
QString cvRef
Definition cvparam.h:73
pappso::cbor::mzcbor::CvParam::valueDouble
double valueDouble
Definition cvparam.h:75
pappso::cbor::mzcbor::CvParam::toJsonObject
QJsonObject toJsonObject() const
write the structure to a JSON object
Definition cvparam.cpp:190
pappso::cbor::mzcbor::CvParam::accession
QString accession
Definition cvparam.h:74
pappso::cbor::mzcbor::CvParam::unitName
QString unitName
Definition cvparam.h:80
pappso::cbor::mzcbor::CvParam::cborType
QCborStreamReader::Type cborType
Definition cvparam.h:83
pappso::cbor::mzcbor::CvParam::valueInt
qint64 valueInt
Definition cvparam.h:76
pappso::cbor::mzcbor::CvParam::setValue
void setValue(const QString &value_str)
Definition cvparam.cpp:224
pappso::cbor::mzcbor::CvParam::unitCvRef
QString unitCvRef
Definition cvparam.h:81
pappso::cbor::mzcbor::CvParam::xmlValueToCbor
void xmlValueToCbor(CborStreamWriter &writer, const QStringView &value_str)
Definition cvparam.cpp:320
pappso::cbor::mzcbor::CvParam::fromMzml
void fromMzml(QXmlStreamReader &reader)
reads the XML attributes of the cvParam element Inside the cvParam XML element, reads the attributes ...
Definition cvparam.cpp:121
pappso::cbor::mzcbor::CvParam::toCbor
void toCbor(CborStreamWriter &writer)
Definition cvparam.cpp:161
pappso::cbor::mzcbor::CvParam::unitAccession
QString unitAccession
Definition cvparam.h:79
pappso::cbor::mzcbor::CvParam::getExpectedQint64
qint64 getExpectedQint64() const
Definition cvparam.cpp:287
pappso::cbor::mzcbor::CvParam::toMzml
void toMzml(QXmlStreamWriter &writer)
Definition cvparam.cpp:232
pappso::cbor::mzcbor::CvParam::getExpectedUint8
std::uint8_t getExpectedUint8() const
Definition cvparam.cpp:271
pappso::cbor::mzcbor::CvParam::name
QString name
Definition cvparam.h:78
pappso::cbor::mzcbor::CvParam::getExpectedDouble
double getExpectedDouble() const
Definition cvparam.cpp:303