1 #ifndef HANDSHAKERESPONSE_P_H
2 #define HANDSHAKERESPONSE_P_H
7 // This file is not part of the Qt API. It exists purely as an
8 // implementation detail. This header file may change from version to
9 // version without notice, or even be removed.
15 #include "qwebsocketprotocol.h"
19 class HandshakeRequest;
23 class HandshakeResponse:public QObject
27 HandshakeResponse(const HandshakeRequest &request,
28 const QString &serverName,
30 const QList<QWebSocketProtocol::Version> &supportedVersions,
31 const QList<QString> &supportedProtocols,
32 const QList<QString> &supportedExtensions);
34 virtual ~HandshakeResponse();
37 bool canUpgrade() const;
38 QString getAcceptedProtocol() const;
39 QString getAcceptedExtension() const;
40 QWebSocketProtocol::Version getAcceptedVersion() const;
47 Q_DISABLE_COPY(HandshakeResponse)
51 QString m_acceptedProtocol;
52 QString m_acceptedExtension;
53 QWebSocketProtocol::Version m_acceptedVersion;
55 QString calculateAcceptKey(const QString &key) const;
56 QString getHandshakeResponse(const HandshakeRequest &request,
57 const QString &serverName,
59 const QList<QWebSocketProtocol::Version> &supportedVersions,
60 const QList<QString> &supportedProtocols,
61 const QList<QString> &supportedExtensions);
63 QTextStream &writeToStream(QTextStream &textStream) const;
64 friend QTextStream &operator <<(QTextStream &stream, const HandshakeResponse &response);
69 #endif // HANDSHAKERESPONSE_P_H