tvl-depot/src/libstore/download.hh

33 lines
482 B
C++
Raw Normal View History

2015-04-09 12:12:50 +02:00
#pragma once
#include "types.hh"
2015-04-09 12:12:50 +02:00
#include <string>
namespace nix {
struct DownloadOptions
{
string expectedETag;
bool verifyTLS{true};
bool forceProgress{false};
};
2015-04-09 12:12:50 +02:00
struct DownloadResult
{
bool cached;
string data, etag;
};
class Store;
DownloadResult downloadFile(string url, const DownloadOptions & options);
2015-04-09 12:12:50 +02:00
Path downloadFileCached(ref<Store> store, const string & url, bool unpack);
MakeError(DownloadError, Error)
bool isUri(const string & s);
2015-04-09 12:12:50 +02:00
}