Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_corelib_serialization_qcborvalue.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QCborValue>
5#include <QCborStreamReader>
6#include <QUuid>
7#include <QCborMap>
8
9void wrapInFunction(QUuid uuid, QCborStreamReader &reader, const QString &key)
10{
11 //! [0]
12 QCborValue(uuid) == QCborValue(QCborKnownTags::Uuid, uuid.toRfc4122());
13 //! [0]
14
15 //! [1]
16 QCborValue value(QCborSimpleType(12));
17 //! [1]
18
19 //! [2]
20 value.isSimpleType(QCborSimpleType(12));
21 //! [2]
22
23 //! [3]
24 QCborValue(QUrl("https://example.com")) == QCborValue(QCborKnownTags::Url, "https://example.com");
25 //! [3]
26
27 //! [4]
28 value.toMap().value(key);
29 //! [4]
30
31 //! [5]
32 value.toMap().value(key);
33 //! [5]
34
35 //! [6]
36 if (reader.isTag() && reader.toTag() == QCborKnownTags::Signature)
37 reader.next();
38
39 QCborValue contents = QCborValue::fromCbor(reader);
40 //! [6]
41}
void wrapInFunction(QUuid uuid, QCborStreamReader &reader, const QString &key)