libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
cborstreamreaderinterface.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/cbor/cborstreamreaderinterface.h
3
* \date 11/02/2025
4
* \author Olivier Langella
5
* \brief common interface to read CBOR streams with convenient framework
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
#pragma once
28
29
#include <QCborStreamReader>
30
#include <QFile>
31
#include "
pappsomspp/export-import-config.h
"
32
#include "
cborstreamreader.h
"
33
34
namespace
pappso::cbor
35
{
36
/**
37
* @brief base class to start a CBOR reader
38
*
39
* containing convenient function to ensure that the stream pointer to the CBOR
40
* source (file or device) is correctly open.
41
*/
42
class
PMSPP_LIB_DECL
CborStreamReaderInterface
43
{
44
public
:
45
/**
46
* Default constructor
47
*/
48
CborStreamReaderInterface
();
49
50
/**
51
* Destructor
52
*/
53
virtual
~CborStreamReaderInterface
();
54
55
/** @brief convenient function to clean pointer before leaving
56
*
57
*/
58
virtual
void
close
();
59
60
protected
:
61
bool
getExpectedString
();
62
63
void
initCborReader
(QFile *pcborfile);
64
65
void
initCborReader
(QIODevice *pcborfile);
66
67
protected
:
68
CborStreamReader
*
mpa_cborReader
=
nullptr
;
69
QString
m_expectedString
;
70
QByteArray
m_data
;
71
};
72
}
// namespace pappso::cbor
cborstreamreader.h
pappso::cbor::CborStreamReaderInterface::close
virtual void close()
convenient function to clean pointer before leaving
Definition
cborstreamreaderinterface.cpp:44
pappso::cbor::CborStreamReaderInterface::CborStreamReaderInterface
CborStreamReaderInterface()
Definition
cborstreamreaderinterface.cpp:30
pappso::cbor::CborStreamReaderInterface::m_expectedString
QString m_expectedString
Definition
cborstreamreaderinterface.h:69
pappso::cbor::CborStreamReaderInterface::initCborReader
void initCborReader(QFile *pcborfile)
Definition
cborstreamreaderinterface.cpp:80
pappso::cbor::CborStreamReaderInterface::getExpectedString
bool getExpectedString()
Definition
cborstreamreaderinterface.cpp:54
pappso::cbor::CborStreamReaderInterface::mpa_cborReader
CborStreamReader * mpa_cborReader
Definition
cborstreamreaderinterface.h:68
pappso::cbor::CborStreamReaderInterface::m_data
QByteArray m_data
Definition
cborstreamreaderinterface.h:70
pappso::cbor::CborStreamReader
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
Definition
cborstreamreader.h:46
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso::cbor
Definition
cborstreamreader.cpp:35
pappsomspp
core
processing
cbor
cborstreamreaderinterface.h
Generated on
for libpappsomspp by
1.15.0