summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qlocalsocket_unix.cpp
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2020-08-06 18:57:43 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2020-08-11 17:21:45 +0300
commit8f53d66e3e412911f4648e88e3e753043fcbfad8 (patch)
treea14e015a4517f0d99a137cbf3e1ad0106ce665ed /src/network/socket/qlocalsocket_unix.cpp
parenta99cee1c7b095a552c04c2aa832574a6f0f44720 (diff)
Introduce QIODevice::skipData()
QIODevice::skip() called a virtual QIODevicePrivate::skip() to implement an efficient skipping on I/O devices for the internal subclasses. The user subclasses cannot inherit QIODevicePrivate, so this functionality was not externally accessible. This patch replaces QIODevicePrivate::skip() with a virtual protected QIODevice::skipData(). While the basic implementation simply discards the data by reading into a dummy buffer, users can reimplement this function to improve the performance in their subclasses. [ChangeLog][QtCore][QIODevice] Added virtual protected skipData(). Now, subclasses can implement device-specific skipping of data. Change-Id: I9522f7f7ab9d03ac06e972a525f8ec2fa909a617 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/network/socket/qlocalsocket_unix.cpp')
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp
index 52067a265c..6fd17a6213 100644
--- a/src/network/socket/qlocalsocket_unix.cpp
+++ b/src/network/socket/qlocalsocket_unix.cpp
@@ -87,11 +87,6 @@ void QLocalSocketPrivate::init()
unixSocket.setParent(q);
}
-qint64 QLocalSocketPrivate::skip(qint64 maxSize)
-{
- return unixSocket.skip(maxSize);
-}
-
void QLocalSocketPrivate::_q_errorOccurred(QAbstractSocket::SocketError socketError)
{
Q_Q(QLocalSocket);
@@ -398,6 +393,11 @@ qint64 QLocalSocket::readData(char *data, qint64 c)
return d->unixSocket.read(data, c);
}
+qint64 QLocalSocket::skipData(qint64 maxSize)
+{
+ return d_func()->unixSocket.skip(maxSize);
+}
+
qint64 QLocalSocket::writeData(const char *data, qint64 c)
{
Q_D(QLocalSocket);