1// Copyright (C) 2020 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#ifndef QBINARYJSON_H
4#define QBINARYJSON_H
5
6#include <QtCore5Compat/qcore5global.h>
7#include <QtCore/qjsondocument.h>
8
9#if 0
10// This is needed for generating the QBinaryJson forward header
11#pragma qt_class(QBinaryJson)
12#endif
13
14QT_BEGIN_NAMESPACE
15
16namespace QBinaryJson {
17
18enum DataValidation {
19 Validate,
20 BypassValidation
21};
22
23Q_CORE5COMPAT_EXPORT QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate);
24Q_CORE5COMPAT_EXPORT const char *toRawData(const QJsonDocument &document, int *size);
25
26Q_CORE5COMPAT_EXPORT QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate);
27Q_CORE5COMPAT_EXPORT QByteArray toBinaryData(const QJsonDocument &document);
28
29} // QBinaryJson
30
31QT_END_NAMESPACE
32
33#endif // QBINARYJSON_H
34

source code of qt5compat/src/core5/serialization/qbinaryjson.h