From 770ef51efa416bf939b237c2e01d7657a7dc6696 Mon Sep 17 00:00:00 2001 From: Kurt Pattyn Date: Sat, 18 Jan 2014 16:21:39 +0100 Subject: Remove dubious functions Change-Id: Ida5c46e3e42685f5e78f2aee657d12af62286810 Reviewed-by: Kurt Pattyn --- src/websockets/qwebsocket.cpp | 33 --------------------------------- src/websockets/qwebsocket.h | 2 -- src/websockets/qwebsocket_p.cpp | 23 ----------------------- src/websockets/qwebsocket_p.h | 2 -- 4 files changed, 60 deletions(-) (limited to 'src/websockets') diff --git a/src/websockets/qwebsocket.cpp b/src/websockets/qwebsocket.cpp index cccaa8c..ada9799 100644 --- a/src/websockets/qwebsocket.cpp +++ b/src/websockets/qwebsocket.cpp @@ -327,39 +327,6 @@ bool QWebSocket::flush() return d->flush(); } -/*! - Sends the given \a message over the socket as a text message and returns the number of bytes - actually sent. - \a message must be '\\0' terminated and is considered to be in UTF-8 encoded format. - - \note When \a message is null or has zero length, zero is returned. - \note The maximum size of message, is limited by \l {QString::}{size_type}. - - \sa QString::fromUtf8(), QString::size_type - */ -qint64 QWebSocket::write(const char *message) -{ - Q_D(QWebSocket); - return d->write(message); -} - -/*! - Sends the most \a maxSize bytes of the given \a message over the socket as a text message - and returns the number of bytes actually sent. - \a message is considered to be in UTF-8 encoded format. - - \note When \a message is null, has zero length or \a maxSize < 0, zero is returned. - \note The maximum size of message, is limited by \l {QString::}{size_type}. - If the message is larger, it is truncated to the maximum value of \l {QString::}{size_type}. - - \sa QString::fromUtf8(), QString::size_type - */ -qint64 QWebSocket::write(const char *message, qint64 maxSize) -{ - Q_D(QWebSocket); - return d->write(message, maxSize); -} - /*! \brief Sends the given \a message over the socket as a text message and returns the number of bytes actually sent. diff --git a/src/websockets/qwebsocket.h b/src/websockets/qwebsocket.h index 4fba278..18f8994 100644 --- a/src/websockets/qwebsocket.h +++ b/src/websockets/qwebsocket.h @@ -104,8 +104,6 @@ public: QWebSocketProtocol::CloseCode closeCode() const; QString closeReason() const; - qint64 write(const char *message) Q_REQUIRED_RESULT; - qint64 write(const char *message, qint64 maxSize) Q_REQUIRED_RESULT; qint64 write(const QString &message) Q_REQUIRED_RESULT; qint64 write(const QByteArray &data) Q_REQUIRED_RESULT; diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index d94b175..bd4d1c1 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -207,29 +207,6 @@ bool QWebSocketPrivate::flush() return result; } -/*! - \internal - */ -qint64 QWebSocketPrivate::write(const char *message) -{ - if (!message || !*message) - return qint64(0); - uint size = qstrlen(message); - qint64 maxSize = qMin(qint64(size), qint64(std::numeric_limits::max())); - return doWriteFrames(QString::fromUtf8(message, maxSize).toUtf8(), false); -} - -/*! - \internal - */ -qint64 QWebSocketPrivate::write(const char *message, qint64 maxSize) -{ - if (!message || (maxSize <= qint64(0)) || !*message) - return qint64(0); - maxSize = qMin(maxSize, qint64(std::numeric_limits::max())); - return doWriteFrames(QString::fromUtf8(message, maxSize).toUtf8(), false); -} - /*! \internal */ diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h index 8f5d054..611c817 100644 --- a/src/websockets/qwebsocket_p.h +++ b/src/websockets/qwebsocket_p.h @@ -140,8 +140,6 @@ public: QWebSocketProtocol::CloseCode closeCode() const; QString closeReason() const; - qint64 write(const char *message) Q_REQUIRED_RESULT; - qint64 write(const char *message, qint64 maxSize) Q_REQUIRED_RESULT; qint64 write(const QString &message) Q_REQUIRED_RESULT; qint64 write(const QByteArray &data) Q_REQUIRED_RESULT; //send data as binary -- cgit v1.2.3