1 #ifndef DATAPROCESSOR_P_H
2 #define DATAPROCESSOR_P_H
8 // This file is not part of the Qt API. It exists purely as an
9 // implementation detail. This header file may change from version to
10 // version without notice, or even be removed.
19 #include "qwebsocketprotocol.h"
27 * @brief The DataProcessor class
29 class DataProcessor: public QObject
33 explicit DataProcessor(QObject *parent = 0);
34 virtual ~DataProcessor();
37 void controlFrameReceived(QWebSocketProtocol::OpCode opCode, QByteArray frame);
38 void textFrameReceived(QString frame, bool lastFrame);
39 void binaryFrameReceived(QByteArray frame, bool lastFrame);
40 void textMessageReceived(QString message);
41 void binaryMessageReceived(QByteArray message);
42 void errorEncountered(QWebSocketProtocol::CloseCode code, QString description);
45 void process(QTcpSocket *pSocket);
49 Q_DISABLE_COPY(DataProcessor)
53 PS_READ_PAYLOAD_LENGTH,
54 PS_READ_BIG_PAYLOAD_LENGTH,
62 QWebSocketProtocol::OpCode m_opCode;
63 bool m_isControlFrame;
66 QByteArray m_binaryMessage;
67 QString m_textMessage;
68 quint64 m_payloadLength;
69 QTextCodec::ConverterState *m_pConverterState;
70 QTextCodec *m_pTextCodec;
75 #endif // DATAPROCESSOR_P_H