-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestparser.h
More file actions
39 lines (32 loc) · 917 Bytes
/
requestparser.h
File metadata and controls
39 lines (32 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef REQUESTPARSER_H
#define REQUESTPARSER_H
#include <QObject>
#include <QTcpSocket>
#include "qhttp.h"
class RequestParser : public QObject
{
Q_OBJECT
int m_socketDescriptor;
bool m_headersDone;
QByteArray m_buffer;
QHttpRequestHeader m_header;
double m_responseHttpVersion;
public:
explicit RequestParser( QObject *parent = 0);
signals:
void write(QByteArray);
void close();
void httpGet(QHttpRequestHeader);
void httpPut(QHttpRequestHeader header, QByteArray content);
void httpPost(QHttpRequestHeader header, QByteArray content);
void httpDelete(QHttpRequestHeader);\
public slots:
void read(QByteArray data);
void serveIndex();
void serveFile(QString filename);
void httpResponse(QHttpResponseHeader header, QByteArray content);
void httpResponseHead(QHttpResponseHeader header);
void httpResponseContent(QByteArray content);
void httpResponseClose();
};
#endif // REQUESTPARSER_H