1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPROTOBUFJSONSERIALIZER_H
5#define QPROTOBUFJSONSERIALIZER_H
6
7#include <QtProtobuf/qtprotobufglobal.h>
8
9#include <QtProtobuf/qabstractprotobufserializer.h>
10
11#include <memory>
12
13QT_BEGIN_NAMESPACE
14
15class QProtobufJsonSerializerPrivate;
16class Q_PROTOBUF_EXPORT QProtobufJsonSerializer final : public QAbstractProtobufSerializer
17{
18 Q_DISABLE_COPY_MOVE(QProtobufJsonSerializer)
19
20public:
21 QProtobufJsonSerializer();
22 ~QProtobufJsonSerializer() override;
23
24 Error lastError() const override;
25 QString lastErrorString() const override;
26
27private:
28 QByteArray serializeMessage(const QProtobufMessage *message) const override;
29 bool deserializeMessage(QProtobufMessage *message, QByteArrayView data) const override;
30
31private:
32 std::unique_ptr<QProtobufJsonSerializerPrivate> d_ptr;
33};
34
35QT_END_NAMESPACE
36
37#endif // QPROTOBUFJSONSERIALIZER_H
38
39

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qtgrpc/src/protobuf/qprotobufjsonserializer.h