pollymc/launcher/net/MetaCacheSink.h
flow 8c8eabf7ac
refactor: organize a little more the code in launcher/net/
This also reduces some code duplication by using some Task logic in
NetAction.
2022-05-12 18:11:49 -03:00

24 lines
566 B
C++

#pragma once
#include "ChecksumValidator.h"
#include "FileSink.h"
#include "net/HttpMetaCache.h"
namespace Net {
class MetaCacheSink : public FileSink {
public:
MetaCacheSink(MetaEntryPtr entry, ChecksumValidator* md5sum);
virtual ~MetaCacheSink() = default;
auto hasLocalData() -> bool override;
protected:
auto initCache(QNetworkRequest& request) -> Task::State override;
auto finalizeCache(QNetworkReply& reply) -> Task::State override;
private:
MetaEntryPtr m_entry;
ChecksumValidator* m_md5Node;
};
} // namespace Net