Files
lix/lix/libutil/references.hh
T
eldritch horrorsandjade b0d7a81613 fix tooling after include reorganization
clangd broke because it can't look through symlinks. compile_commands
manipulation does not fix it, clangd configuration does not fix it, a
vfs overlay does not fix it, and while a combination of those can fix
it with a bind mount in place that's just too cursed to even consider

clangd bug: https://github.com/llvm/llvm-project/issues/116877

Change-Id: I8e3e8489548eb3a7aa65ac9d12a5ec8abf814aec
2024-11-19 22:55:32 +00:00

49 lines
1.1 KiB
C++

#pragma once
///@file
#include "lix/libutil/hash.hh"
namespace nix {
class RefScanSink : public Sink
{
StringSet hashes;
StringSet seen;
std::string tail;
public:
RefScanSink(StringSet && hashes) : hashes(hashes)
{ }
StringSet & getResult()
{ return seen; }
void operator () (std::string_view data) override;
};
struct RewritingSource : Source
{
const std::string::size_type maxRewriteSize;
const std::string initials;
const StringMap rewrites;
std::string rewritten, buffered;
std::string_view unreturned;
Source * inner;
static constexpr struct may_change_size_t {
explicit may_change_size_t() = default;
} may_change_size{};
RewritingSource(const std::string & from, const std::string & to, Source & inner);
RewritingSource(StringMap rewrites, Source & inner);
RewritingSource(may_change_size_t, StringMap rewrites, Source & inner);
size_t read(char * data, size_t len) override;
};
HashResult computeHashModulo(HashType ht, const std::string & modulus, Source & source);
}