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
removed_api.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 Intel Corporation.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#define QT_BLUETOOTH_BUILD_REMOVED_API
5
6// Undefine Qt 128-bit int types
7#ifndef QT_NO_INT128
8# define QT_NO_INT128
9#endif
10
12
13QT_USE_NAMESPACE
14
15#if QT_BLUETOOTH_REMOVED_SINCE(6, 6)
16
17#include "qbluetoothaddress.h" // inlined API
18
19#include "qbluetoothuuid.h"
20
21static_assert(std::is_aggregate_v<quint128>);
22static_assert(std::is_trivial_v<quint128>);
23
24// These legacy functions can't just call the new (quint128, Endian) overloads,
25// as the latter may see either QtCore's quint128 (__int128 built-in) _or_ our
26// fake version from qbluetoothuuid.h. This TU must _always_ see the fake ones
27// (as that is what we had in 6.5):
28#ifdef QT_SUPPORTS_INT128
29# error This TU requires QT_NO_INT128 to be defined.
30#endif
31
32QBluetoothUuid::QBluetoothUuid(quint128 uuid)
33 : QUuid(fromBytes(uuid.data))
34{}
35
36quint128 QBluetoothUuid::toUInt128() const
37{
38 quint128 uuid;
39 const auto bytes = toBytes();
40 memcpy(uuid.data, bytes.data, sizeof(uuid.data));
41 return uuid;
42}
43
44// END quint128 functions
45
46QBluetoothUuid::QBluetoothUuid(const QString &uuid)
47 : QUuid(qToAnyStringViewIgnoringNull(uuid))
48{
49}
50
51#ifndef QT_NO_DEBUG_STREAM
52QDebug QBluetoothUuid::streamingOperator(QDebug debug, const QBluetoothUuid &uuid)
53{
54 debug << uuid.toString();
55 return debug;
56}
57#endif // QT_NO_DEBUG_STREAM
58
59#endif // QT_BLUETOOTH_REMOVED_SINCE(6, 6)