2016-02-16 15:38:44 +00:00
|
|
|
#pragma once
|
2023-04-01 03:18:41 +00:00
|
|
|
///@file
|
2016-02-16 15:38:44 +00:00
|
|
|
|
|
|
|
#include "types.hh"
|
|
|
|
#include "hash.hh"
|
2020-08-06 18:31:48 +00:00
|
|
|
#include "path-info.hh"
|
2016-02-16 15:38:44 +00:00
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
2020-08-06 18:31:48 +00:00
|
|
|
class Store;
|
|
|
|
|
2016-02-16 15:38:44 +00:00
|
|
|
struct NarInfo : ValidPathInfo
|
|
|
|
{
|
|
|
|
std::string url;
|
|
|
|
std::string compression;
|
2020-06-19 20:50:28 +00:00
|
|
|
std::optional<Hash> fileHash;
|
2016-02-16 15:38:44 +00:00
|
|
|
uint64_t fileSize = 0;
|
|
|
|
|
2019-12-05 18:11:09 +00:00
|
|
|
NarInfo() = delete;
|
2020-08-06 18:31:48 +00:00
|
|
|
NarInfo(StorePath && path, Hash narHash) : ValidPathInfo(std::move(path), narHash) { }
|
2016-02-16 15:38:44 +00:00
|
|
|
NarInfo(const ValidPathInfo & info) : ValidPathInfo(info) { }
|
2016-06-01 12:49:12 +00:00
|
|
|
NarInfo(const Store & store, const std::string & s, const std::string & whence);
|
2016-02-16 15:38:44 +00:00
|
|
|
|
2019-12-05 18:11:09 +00:00
|
|
|
std::string to_string(const Store & store) const;
|
2016-02-16 15:38:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|