-
Notifications
You must be signed in to change notification settings - Fork 0
/
request.h
executable file
·55 lines (44 loc) · 1.13 KB
/
request.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef NEWREQUEST_H
#define NEWREQUEST_H
#include <QObject>
#include <QAbstractSocket>
#include <QRegularExpression>
#include <QCryptographicHash>
#include <QDir>
#include <QDateTime>
#include <QFileInfoList>
class Request : public QObject
{
Q_OBJECT
private:
QAbstractSocket *socket;
QString *rawData;
QString rawHead;
QString rawBody;
bool isValid();
int isValidUserPw(bool create);
struct RequestParsed{
QString name; // name of request
QString rosiVersion;
QString userId;
QString checksum;
QString pw;
QString data;
int datalen;
}request;
public:
Request(QAbstractSocket *s, QObject *parent);
~Request ();
private slots:
void readData();
void handleError(QAbstractSocket::SocketError);
void handleError(QString error);
void executeRequest();
void addBackup();
void restoreBackup();
void listBackups();
void testUser();
signals:
void requestFinished();
};
#endif // NEWREQUEST_H