| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassCore
- MassDataCborBaseHandler

# MsXpS::libXpertMassCore::MassDataCborBaseHandler Class

class MsXpS::libXpertMassCore::MassDataCborBaseHandler

The MassDataCborBaseHandler class provides features to handle mass spectrometric data using the CBOR (Concise Binary Object Representation) container streaming classes. More...

Header: | `#include <MsXpS/libXpertMassCore/MassDataCborBaseHandler.hpp>`
Inherits: | QObject
Inherited By: | MsXpS::libXpertMassCore::MassDataCborMassSpectrumHandler

- List of all members, including inherited members
- MassDataCborBaseHandler is part of libXpertMassCore Utilities.

## Public Functions

| MassDataCborBaseHandler(QObject *parent_p)
virtual | ~MassDataCborBaseHandler()
MsXpS::libXpertMassCore::Enums::MassDataType | getMassDataType() const
QString | getTitle() const
virtual bool | readByteArray(const QByteArray &byte_array)
virtual bool | readFile(const QString &input_file_name = QString())
void | setInputFileName(const QString &file_name)
void | setMassDataType(MsXpS::libXpertMassCore::Enums::MassDataType mass_data_type)
void | setOutputFileName(const QString &file_name)
void | setTitle(const QString &title)
virtual void | writeByteArray(QByteArray &byte_array)
virtual bool | writeFile(const QString &output_file_name = QString())

## Static Public Members

MsXpS::libXpertMassCore::Enums::MassDataType | readMassDataType(MsXpS::libXpertMassCore::QCborStreamReaderSPtr &reader_sp)
MsXpS::libXpertMassCore::Enums::MassDataType | readMassDataType(const QByteArray &byte_array)
MsXpS::libXpertMassCore::Enums::MassDataType | readMassDataType(const QString &input_file_name)

## Protected Functions

virtual bool | decodeStream(MsXpS::libXpertMassCore::QCborStreamReaderSPtr &reader_sp)

## Detailed Description

The data transported using CBOR is first qualified using the Enums::MassDataType enum. The data are packed following that mass data type specification.

## Member Function Documentation

### MassDataCborBaseHandler::MassDataCborBaseHandler(QObject *parent_p)

Constructs a MassDataCborBaseHandler instance setting parent to parent_p.

### `[virtual noexcept]` MassDataCborBaseHandler::~MassDataCborBaseHandler()

Destructs the MassDataCborBaseHandler instance.

### `[virtual protected]` bool MassDataCborBaseHandler::decodeStream(MsXpS::libXpertMassCore::QCborStreamReaderSPtr &reader_sp)

Decodes the data stream from reader_sp.

Note: The base class does nothing and always returns false.

### MsXpS::libXpertMassCore::Enums::MassDataType MassDataCborBaseHandler::getMassDataType() const

Returns the mass data type.

### QString MassDataCborBaseHandler::getTitle() const

Returns the title of the mass data entity carried by the CBOR container.

### `[virtual]` bool MassDataCborBaseHandler::readByteArray(const QByteArray &byte_array)

Reads the data in byte array byte_array by decoding the data stream read from it.

Note: The base class does nothing and always returns false.

### `[virtual]` bool MassDataCborBaseHandler::readFile(const QString &input_file_name = QString())

Reads the data in file input_file_name by decoding the data stream read from it.

Note: The base class does nothing and always returns false.

### `[static]` MsXpS::libXpertMassCore::Enums::MassDataType MassDataCborBaseHandler::readMassDataType(MsXpS::libXpertMassCore::QCborStreamReaderSPtr &reader_sp)

Decodes enough of the data streamed by reader_sp to determine and return the mass data type of the streamed data.

Note: Failure to decode the mass data type is fatal.

### `[static]` MsXpS::libXpertMassCore::Enums::MassDataType MassDataCborBaseHandler::readMassDataType(const QByteArray &byte_array)

Decodes enough of the data contained in byte_array to determine and return the mass data type of the streamed data.

Note: Failure to decode the mass data type is fatal.

This is an overloaded function.

See also readMassDataType().

### `[static]` MsXpS::libXpertMassCore::Enums::MassDataType MassDataCborBaseHandler::readMassDataType(const QString &input_file_name)

Decodes enough of the data contained in file input_file_name to determine and return the mass data type of the streamed data.

Note: Failure to decode the mass data type is fatal.

This is an overloaded function.

See also readMassDataType().

### void MassDataCborBaseHandler::setInputFileName(const QString &file_name)

Sets the input file name to file_name.

### void MassDataCborBaseHandler::setMassDataType(MsXpS::libXpertMassCore::Enums::MassDataType mass_data_type)

Sets the mass data type to mass_data_type.

### void MassDataCborBaseHandler::setOutputFileName(const QString &file_name)

Sets the output file name to file_name.

### void MassDataCborBaseHandler::setTitle(const QString &title)

Sets the title of the mass data entity carried by the CBOR container.

### `[virtual]` void MassDataCborBaseHandler::writeByteArray(QByteArray &byte_array)

Writes member data to byte array byte_array.

Note: The base class does nothing and always returns false.

### `[virtual]` bool MassDataCborBaseHandler::writeFile(const QString &output_file_name = QString())

Writes member data to file output_file_name.

Note: The base class does nothing and always returns false.