Loading...
Searching...
No Matches
pappso::cbor::mzcbor::CvParamMap Struct Reference

`#include <cvparammap.h>`

Inheritance diagram for pappso::cbor::mzcbor::CvParamMap:

## Public Member Functions

void | fromCbor (CborStreamReader &reader)
| fill the structure reading data from a CBOR stream
QJsonArray | toJsonArray () const
| write the structure to a JSON array

## Detailed Description

Todo
  write docs

Definition at line 45 of file cvparammap.h.

## Member Function Documentation

## fromCbor()

void pappso::cbor::mzcbor::CvParamMap::fromCbor | ( | CborStreamReader & | reader | ) |

fill the structure reading data from a CBOR stream

Parameters

  reader | CBOR stream

Definition at line 33 of file cvparammap.cpp.

{
qDebug();
if(!reader.isArray())
{
throw pappso::PappsoException("this is not an array of cvParams");
}
reader.enterContainer(); // start array
while(reader.hasNext())
{
qDebug();
CvParam cv_param;
cv_param.fromCbor(reader);
insert({cv_param.accession, cv_param});
qDebug() << cv_param.accession;
}
reader.leaveContainer(); // end array
qDebug();
}

References pappso::cbor::mzcbor::CvParam::accession, and pappso::cbor::mzcbor::CvParam::fromCbor().

Referenced by pappso::cbor::mzcbor::Spectrum::readScanCvParams(), and pappso::cbor::mzcbor::ConvertToMzml::writeElementInMzml().

## toJsonArray()

QJsonArray pappso::cbor::mzcbor::CvParamMap::toJsonArray | ( |  | ) | const

write the structure to a JSON array

Returns
  QJsonObject

Definition at line 59 of file cvparammap.cpp.

{
QJsonArray cv_array;
for(auto const &[key, val] : *this)
{
cv_array.append(val.toJsonObject());
}
return cv_array;
}

The documentation for this struct was generated from the following files:

- pappsomspp/core/processing/cbor/mzcbor/cvparammap.h
- pappsomspp/core/processing/cbor/mzcbor/cvparammap.cpp