blob: 035d5bfd5e6e0935ae156fc52a609e2c93af5cee (
plain)
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
|
#pragma once
#include "Sink.h"
#include <QSaveFile>
namespace Net {
class FileSink : public Sink
{
public: /* con/des */
FileSink(QString filename);
virtual ~FileSink();
public: /* methods */
JobStatus init(QNetworkRequest & request) override;
JobStatus write(QByteArray & data) override;
JobStatus abort() override;
JobStatus finalize(QNetworkReply & reply) override;
bool hasLocalData() override;
protected: /* methods */
virtual JobStatus initCache(QNetworkRequest &);
virtual JobStatus finalizeCache(QNetworkReply &reply);
protected: /* data */
QString m_filename;
bool wroteAnyData = false;
std::unique_ptr<QSaveFile> m_output_file;
};
}
|