#include <QtCore/QSet>
#include <QtCore/QtEndian>
+QT_BEGIN_NAMESPACE
+
+/*!
+ \namespace QWebSocketProtocol
+ \inmodule QtWebSockets
+ \brief Contains constants related to the WebSocket standard.
+*/
+
/*!
\enum QWebSocketProtocol::CloseCode
\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;
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);
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),
while (size-- > 0)
*payload++ ^= mask[i++ % 4];
}
-} //end namespace WebSocketProtocol
QT_END_NAMESPACE
$$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 \