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 | |
14 | QT_BEGIN_NAMESPACE |
15 | |
16 | namespace QBinaryJson { |
17 | |
18 | enum DataValidation { |
19 | Validate, |
20 | BypassValidation |
21 | }; |
22 | |
23 | Q_CORE5COMPAT_EXPORT QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate); |
24 | Q_CORE5COMPAT_EXPORT const char *toRawData(const QJsonDocument &document, int *size); |
25 | |
26 | Q_CORE5COMPAT_EXPORT QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate); |
27 | Q_CORE5COMPAT_EXPORT QByteArray toBinaryData(const QJsonDocument &document); |
28 | |
29 | } // QBinaryJson |
30 | |
31 | QT_END_NAMESPACE |
32 | |
33 | #endif // QBINARYJSON_H |
34 |