ifndef VK_H define VK_H include QString include QJsonDocument include

 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
#ifndef VK_H
#define VK_H
#include <QString>
#include <QJsonDocument>
#include <map>
class VK;
class VKAnswer;
class VKError;
class VKResponse;
class VK {
public:
VK(QString token);
QString request(QString method, std::map<QString, QString> data);
~VK();
private:
QString token;
};
class VKAnswer {
public:
VKAnswer(VKError error, VKResponse response);
VKError error;
VKResponse response;
~VKAnswer();
};
class VKResponse {
public:
VKResponse(QString json);
QJsonObject data;
~VKResponse();
};
class VKError {
public:
VKError(QString json);
QString text();
int error();
~VKError();
unsigned int NoError = 0;
unsigned int CaptchaError = 1;
unsigned int TokenError = 2;
unsigned int AnotherError = 65535;
private:
QString text;
};
#endif // VK_H