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
qapple_utils_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef QAPPLE_UTILS_P_H
16#define QAPPLE_UTILS_P_H
17
18#include <QtCore/qdebug.h>
19#include <QtCore/qendian.h>
20#include <QtCore/qglobal.h>
21
22#ifdef Q_OS_MACOS
23# include <CoreAudioTypes/CoreAudioTypes.h>
24#endif
25
26QT_BEGIN_NAMESPACE
27
28namespace QtMultimediaPrivate {
29
31{
33 explicit QOSStatus(OSStatus s) : status(s) {}
34
35 friend QDebug operator<<(QDebug dbg, const QOSStatus &qos)
36 {
37 QDebugStateSaver saver(dbg);
38 dbg.noquote();
39
40 if (qos.status == noErr) {
41 dbg << "noErr";
42 return dbg;
43 }
44
45 std::array<char, 4> buf;
46 qToBigEndian(qos.status, buf.data());
47
48 bool isPrintable = std::all_of(buf.begin(), buf.end(), [](unsigned char c) {
49 return std::isprint(c);
50 });
51
52 if (isPrintable)
53 return dbg << QLatin1String(buf.data(), buf.size());
54 else
55 return dbg << qos.status;
56 }
57};
58
59} // namespace QtMultimediaPrivate
60
61QT_END_NAMESPACE
62
63#endif // QAPPLE_UTILS_P_H
friend QDebug operator<<(QDebug dbg, const QOSStatus &qos)