#pragma once #include "source-accessor.hh" namespace nix { /** * A source accessor that just forwards every operation to another * accessor. This is not useful in itself but can be used as a * superclass for accessors that do change some operations. */ struct ForwardingSourceAccessor : SourceAccessor { ref next; ForwardingSourceAccessor(ref next) : next(next) { } std::string readFile(const CanonPath & path) override { return next->readFile(path); } void readFile(const CanonPath & path, Sink & sink, std::function sizeCallback) override { next->readFile(path, sink, sizeCallback); } std::optional maybeLstat(const CanonPath & path) override { return next->maybeLstat(path); } DirEntries readDirectory(const CanonPath & path) override { return next->readDirectory(path); } std::string readLink(const CanonPath & path) override { return next->readLink(path); } std::string showPath(const CanonPath & path) override { return next->showPath(path); } std::optional getPhysicalPath(const CanonPath & path) override { return next->getPhysicalPath(path); } }; }