-
Notifications
You must be signed in to change notification settings - Fork 4
/
payload.h
37 lines (34 loc) · 960 Bytes
/
payload.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
#ifndef PAYLOAD_H
#define PAYLOAD_H
#include <QIODevice>
#include <QString>
#include <QFile>
#include <QFileInfo>
#include <QSettings>
#include <QJsonDocument>
class Payload : public QIODevice
{
public:
Payload(QFile * file, QJsonDocument & json_document);
~Payload();
qint64 size() const;
qint64 pos() const;
qint64 position;
QIODevice::OpenMode openMode() const;
qint64 bytesAvailable() const;
bool open(QIODevice::OpenMode mode);
void close();
bool atEnd() const;
bool canReadLine() const;
bool isSequential() const;
static QString cont_disp_str, boundary, endline, start_delim, stop_delim;
QByteArray payload_start;
QFile * upload_file;
QFileInfo upload_file_info;
QSettings settings;
protected:
qint64 readData( char * data, qint64 maxSize );
qint64 writeData(const char *data, qint64 len);
void addFormParam(const char * name, const char * value);
};
#endif // PAYLOAD_H