summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-05-19 11:15:11 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-05-19 19:48:17 +0200
commitd95e39a9b8e35d377e8bbcb3dd848c3a5b276016 (patch)
tree886c9f71191803f944b98745a4e0c4d794aa3d03 /src
parent8827cd657d12a037deb3e6f4f76271ee0bbd0b13 (diff)
QNetworkAddressEntry: export QDebug stream operator
It already existed, but was only used internally in QNetworkInterface's debug stream operator. Change-Id: I36c2b4f6cb228df2f92ec92cc879b6d34f1e3ea1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/kernel/qnetworkinterface.cpp21
-rw-r--r--src/network/kernel/qnetworkinterface.h1
2 files changed, 19 insertions, 3 deletions
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index b8ba9fcd07..ddde994a6e 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -931,17 +931,32 @@ static inline QDebug flagsDebug(QDebug debug, QNetworkInterface::InterfaceFlags
return debug;
}
-static inline QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry)
+/*!
+ \since 6.2
+
+ Writes the QNetworkAddressEntry \a entry to the stream and
+ returns a reference to the stream.
+
+ \relates QNetworkAddressEntry
+ */
+QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry)
{
- debug << "(address = " << entry.ip();
+ QDebugStateSaver saver(debug);
+ debug.resetFormat().nospace();
+ debug << "address = " << entry.ip();
if (!entry.netmask().isNull())
debug << ", netmask = " << entry.netmask();
if (!entry.broadcast().isNull())
debug << ", broadcast = " << entry.broadcast();
- debug << ')';
return debug;
}
+/*!
+ Writes the QNetworkInterface \a networkInterface to the stream and
+ returns a reference to the stream.
+
+ \relates QNetworkInterface
+ */
QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface)
{
QDebugStateSaver saver(debug);
diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h
index b96ca0e5fa..ef4dce1c01 100644
--- a/src/network/kernel/qnetworkinterface.h
+++ b/src/network/kernel/qnetworkinterface.h
@@ -176,6 +176,7 @@ Q_DECLARE_SHARED(QNetworkInterface)
Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkInterface::InterfaceFlags)
#ifndef QT_NO_DEBUG_STREAM
+Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry);
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface);
#endif