summaryrefslogtreecommitdiffstats
path: root/api/logic/net/MetaCacheSink.h
blob: 8df03d06fe3eea6fa96ea8540fff1e3b08b3b350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include "FileSink.h"
#include "ChecksumValidator.h"
#include "net/HttpMetaCache.h"

namespace Net {
class MetaCacheSink : public FileSink
{
public: /* con/des */
	MetaCacheSink(MetaEntryPtr entry, ChecksumValidator * md5sum);
	virtual ~MetaCacheSink();
	bool hasLocalData() override;

protected: /* methods */
	Task::Status initCache(QNetworkRequest & request) override;
	Task::Status finalizeCache(QNetworkReply & reply) override;

private: /* data */
	MetaEntryPtr m_entry;
	ChecksumValidator * m_md5Node;
};
}