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 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class QProtobufJsonSerializerPrivate; |
16 | class Q_PROTOBUF_EXPORT QProtobufJsonSerializer final : public QAbstractProtobufSerializer |
17 | { |
18 | Q_DISABLE_COPY_MOVE(QProtobufJsonSerializer) |
19 | |
20 | public: |
21 | QProtobufJsonSerializer(); |
22 | ~QProtobufJsonSerializer() override; |
23 | |
24 | Error lastError() const override; |
25 | QString lastErrorString() const override; |
26 | |
27 | private: |
28 | QByteArray serializeMessage(const QProtobufMessage *message) const override; |
29 | bool deserializeMessage(QProtobufMessage *message, QByteArrayView data) const override; |
30 | |
31 | private: |
32 | std::unique_ptr<QProtobufJsonSerializerPrivate> d_ptr; |
33 | }; |
34 | |
35 | QT_END_NAMESPACE |
36 | |
37 | #endif // QPROTOBUFJSONSERIALIZER_H |
38 | |
39 |