From a3f715c477a86b164c7db7a1740ac2ac3b21dbc7 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 9 Jan 2014 19:22:20 +0100 Subject: [PATCH] Enable docs for QWebSocketProtocol There is no advantage to haveing the cpp files have _p.cpp and as the public docs are in this file, rename it. In order to have the docs generated there needs to be a namespace page. Change-Id: Id6ef10ba39b7ea8b18d5d8e1cde03e566e682926 Reviewed-by: Kurt Pattyn --- ...socketprotocol_p.cpp => qwebsocketprotocol.cpp} | 24 +++++++++++----------- src/websockets/websockets.pro | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) rename src/websockets/{qwebsocketprotocol_p.cpp => qwebsocketprotocol.cpp} (94%) diff --git a/src/websockets/qwebsocketprotocol_p.cpp b/src/websockets/qwebsocketprotocol.cpp similarity index 94% rename from src/websockets/qwebsocketprotocol_p.cpp rename to src/websockets/qwebsocketprotocol.cpp index 0fb7840..e25767a 100644 --- a/src/websockets/qwebsocketprotocol_p.cpp +++ b/src/websockets/qwebsocketprotocol.cpp @@ -44,6 +44,14 @@ #include #include +QT_BEGIN_NAMESPACE + +/*! + \namespace QWebSocketProtocol + \inmodule QtWebSockets + \brief Contains constants related to the WebSocket standard. +*/ + /*! \enum QWebSocketProtocol::CloseCode @@ -65,7 +73,7 @@ \value CC_BAD_OPERATION Internal server error \value CC_TLS_HANDSHAKE_FAILED TLS handshake failed - \sa \l{QWebSocket::} {close()} + \sa QWebSocket::close() */ /*! \enum QWebSocketProtocol::Version @@ -122,18 +130,11 @@ \internal */ -QT_BEGIN_NAMESPACE - -/** - * @brief Contains constants related to the WebSocket standard. - */ -namespace QWebSocketProtocol -{ /*! Parses the \a versionString and converts it to a Version value \internal */ -Version versionFromString(const QString &versionString) +QWebSocketProtocol::Version QWebSocketProtocol::versionFromString(const QString &versionString) { bool ok = false; Version version = V_Unknow; @@ -149,7 +150,7 @@ Version versionFromString(const QString &versionString) Mask the \a payload with the given \a maskingKey and stores the result back in \a payload. \internal */ -void mask(QByteArray *payload, quint32 maskingKey) +void QWebSocketProtocol::mask(QByteArray *payload, quint32 maskingKey) { Q_ASSERT(payload); mask(payload->data(), payload->size(), maskingKey); @@ -159,7 +160,7 @@ void mask(QByteArray *payload, quint32 maskingKey) Masks the \a payload of length \a size with the given \a maskingKey and stores the result back in \a payload. \internal */ -void mask(char *payload, quint64 size, quint32 maskingKey) +void QWebSocketProtocol::mask(char *payload, quint64 size, quint32 maskingKey) { Q_ASSERT(payload); const quint8 mask[] = { quint8((maskingKey & 0xFF000000u) >> 24), @@ -171,6 +172,5 @@ void mask(char *payload, quint64 size, quint32 maskingKey) while (size-- > 0) *payload++ ^= mask[i++ % 4]; } -} //end namespace WebSocketProtocol QT_END_NAMESPACE diff --git a/src/websockets/websockets.pro b/src/websockets/websockets.pro index 3964b73..90efe3b 100644 --- a/src/websockets/websockets.pro +++ b/src/websockets/websockets.pro @@ -34,7 +34,7 @@ SOURCES += \ $$PWD/qwebsocket_p.cpp \ $$PWD/qwebsocketserver.cpp \ $$PWD/qwebsocketserver_p.cpp \ - $$PWD/qwebsocketprotocol_p.cpp \ + $$PWD/qwebsocketprotocol.cpp \ $$PWD/qwebsockethandshakerequest_p.cpp \ $$PWD/qwebsockethandshakeresponse_p.cpp \ $$PWD/qwebsocketdataprocessor_p.cpp \ -- 2.7.4