libLicenseClient/api/CachedDownloader.h
2018-03-27 23:03:06 +02:00

27 lines
561 B
C++

#pragma once
#include "HTTPClient.h"
#include "IDownloader.h"
#include <boost/filesystem.hpp>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <iostream>
class CachedDownloader : public IDownloader
{
public:
CachedDownloader(const boost::filesystem::path& cacheDir, HTTPClient& httpClient);
public:
boost::filesystem::path download(const std::string& url) override;
void clearCache();
private:
boost::filesystem::path m_cacheDir;
std::map<std::string, std::string> m_cache;
HTTPClient& m_httpClient;
};