Enable docs for QWebSocketProtocol
authorFrederik Gladhorn <frederik.gladhorn@digia.com>
Thu, 9 Jan 2014 18:22:20 +0000 (19:22 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 11 Jan 2014 17:22:09 +0000 (18:22 +0100)
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 <pattyn.kurt@gmail.com>
src/websockets/qwebsocketprotocol.cpp [moved from src/websockets/qwebsocketprotocol_p.cpp with 94% similarity]
src/websockets/websockets.pro

similarity index 94%
rename from src/websockets/qwebsocketprotocol_p.cpp
rename to src/websockets/qwebsocketprotocol.cpp
index 0fb7840..e25767a 100644 (file)
 #include <QtCore/QSet>
 #include <QtCore/QtEndian>
 
+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
   \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
index 3964b73..90efe3b 100644 (file)
@@ -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 \