1// Copyright (C) 2025 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_P_H
5#define QPROTOBUFJSONSERIALIZER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtProtobuf/qtprotobufexports.h>
19
20#include <QtCore/qtconfigmacros.h>
21
22QT_BEGIN_NAMESPACE
23
24class QProtobufMessage;
25class QJsonValue;
26class QMetaType;
27
28namespace QtProtobufPrivate {
29
30struct QProtobufFieldInfo;
31
32using CustomJsonSerializer = QJsonValue (*)(const QProtobufMessage *);
33using CustomJsonDeserializer = bool (*)(QProtobufMessage *, const QJsonValue &);
34
35Q_PROTOBUF_EXPORT void registerCustomJsonHandler(QMetaType metaType,
36 CustomJsonSerializer serializer,
37 CustomJsonDeserializer deserializer);
38
39[[nodiscard]] CustomJsonSerializer findCustomJsonSerializer(QMetaType metaType);
40[[nodiscard]] CustomJsonDeserializer findCustomJsonDeserializer(QMetaType metaType);
41}
42
43QT_END_NAMESPACE
44
45#endif // QPROTOBUFJSONSERIALIZER_P_H
46

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

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