Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
references.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/hash.hh
"
5
6
namespace
nix {
7
8
class
RefScanSink :
public
Sink
9
{
10
StringSet
hashes;
11
StringSet
seen;
12
13
std::string tail;
14
15
void
anchor()
override
;
16
17
public
:
18
19
RefScanSink(
StringSet
&& hashes)
20
: hashes(hashes)
21
{
22
}
23
24
StringSet
& getResult()
25
{
26
return
seen;
27
}
28
29
void
operator()(std::string_view data)
override
;
30
};
31
32
struct
RewritingSink :
Sink
33
{
34
private
:
35
void
anchor()
override
;
36
37
public
:
38
const
StringMap
rewrites;
39
std::string::size_type maxRewriteSize;
40
std::string prev;
41
Sink
& nextSink;
42
uint64_t pos = 0;
43
44
std::set<uint64_t> matches;
45
46
RewritingSink(
const
std::string & from,
const
std::string & to,
Sink
& nextSink);
47
RewritingSink(
const
StringMap
& rewrites,
Sink
& nextSink);
48
49
void
operator()(std::string_view data)
override
;
50
51
void
flush();
52
};
53
54
struct
MaskedHashSink :
AbstractHashSink
55
{
56
private
:
57
void
anchor()
override
;
58
59
public
:
60
HashSink
hashSink;
61
RewritingSink
rewritingSink;
62
63
MaskedHashSink(HashAlgorithm ha,
const
std::string & modulus);
64
65
void
operator()(std::string_view data)
override
;
66
67
HashResult
finish()
override
;
68
};
69
70
}
// namespace nix
nix::HashSink
Definition
hash.hh:226
hash.hh
nix::AbstractHashSink
Definition
hash.hh:218
nix::HashResult
Definition
hash.hh:174
nix::RewritingSink
Definition
references.hh:33
nix::Sink
Definition
serialise.hh:18
nix::StringMap
std::map< std::string, std::string, std::less<> > StringMap
Definition
types.hh:26
nix::StringSet
std::set< std::string, std::less<> > StringSet
Definition
types.hh:45
libstore
include
nix
store
references.hh
Generated by
1.18.0