1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 06:11:46 +02:00

SourceAccessor::readFile(): Support reading into a sink

This commit is contained in:
Eelco Dolstra 2023-10-20 16:36:41 +02:00
parent 7a086a32bc
commit 57db3be9e4
5 changed files with 94 additions and 13 deletions

View file

@ -19,11 +19,14 @@ struct FSInputAccessorImpl : FSInputAccessor, PosixSourceAccessor
{
}
std::string readFile(const CanonPath & path) override
void readFile(
const CanonPath & path,
Sink & sink,
std::function<void(uint64_t)> sizeCallback) override
{
auto absPath = makeAbsPath(path);
checkAllowed(absPath);
return PosixSourceAccessor::readFile(absPath);
PosixSourceAccessor::readFile(absPath, sink, sizeCallback);
}
bool pathExists(const CanonPath & path) override