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:
parent
7a086a32bc
commit
57db3be9e4
5 changed files with 94 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue