Nix
2.26.3
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nar-info.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
types.hh
"
5
#include "hash.hh"
6
#include "
path-info.hh
"
7
8
namespace
nix {
9
10
class
Store
;
11
12
struct
NarInfo : ValidPathInfo
13
{
14
std::string url;
15
std::string compression;
16
std::optional<Hash> fileHash;
17
uint64_t fileSize = 0;
18
19
NarInfo() =
delete
;
20
NarInfo(
const
Store
&
store
, std::string
name
,
ContentAddressWithReferences
ca
,
Hash
narHash
)
21
: ValidPathInfo(
store
, std::move(
name
), std::move(
ca
),
narHash
)
22
{ }
23
NarInfo(
StorePath
path,
Hash
narHash
) : ValidPathInfo(std::move(path),
narHash
) { }
24
NarInfo(
const
ValidPathInfo & info) : ValidPathInfo(info) { }
25
NarInfo(
const
Store
&
store
,
const
std::string &
s
,
const
std::string & whence);
26
27
bool
operator ==(
const
NarInfo &)
const
=
default
;
28
// TODO libc++ 16 (used by darwin) missing `std::optional::operator <=>`, can't do yet
29
//auto operator <=>(const NarInfo &) const = default;
30
31
std::string to_string(
const
Store
&
store
)
const
;
32
33
nlohmann::json
toJSON
(
34
const
Store
&
store
,
35
bool
includeImpureInfo,
36
HashFormat
hashFormat)
const override
;
37
static
NarInfo fromJSON(
38
const
Store
&
store
,
39
const
StorePath
& path,
40
const
nlohmann::json & json);
41
};
42
43
}
nix::StorePath
Definition
path.hh:27
nix::Store
Definition
store-api.hh:169
store
ChunkedVector< std::string, 8192 > store
Definition
lexer.l:1011
s
return s
Definition
lexer.l:459
toJSON
virtual nlohmann::json toJSON()=0
name
const std::string_view & name
Definition
lexer.l:1709
nix::HashFormat
HashFormat
Enumeration representing the hash formats.
Definition
hash.hh:29
path-info.hh
nix::ContentAddressWithReferences
Definition
content-address.hh:276
nix::Hash
Definition
hash.hh:45
nix::UnkeyedValidPathInfo::ca
std::optional< ContentAddress > ca
Definition
path-info.hh:102
nix::UnkeyedValidPathInfo::narHash
Hash narHash
Definition
path-info.hh:51
types.hh
src
libstore
nar-info.hh
Generated by
1.13.2