mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +02:00
Deduplicate FSSourceAccessor and FSInputAccessor
This commit is contained in:
parent
9f572eb0e3
commit
50156302c0
4 changed files with 82 additions and 74 deletions
|
@ -93,4 +93,28 @@ struct SourceAccessor
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A source accessor that uses the Unix filesystem.
|
||||
*/
|
||||
struct PosixSourceAccessor : SourceAccessor
|
||||
{
|
||||
/**
|
||||
* The most recent mtime seen by lstat(). This is a hack to
|
||||
* support dumpPathAndGetMtime(). Should remove this eventually.
|
||||
*/
|
||||
time_t mtime = 0;
|
||||
|
||||
std::string readFile(const CanonPath & path) override;
|
||||
|
||||
bool pathExists(const CanonPath & path) override;
|
||||
|
||||
Stat lstat(const CanonPath & path) override;
|
||||
|
||||
DirEntries readDirectory(const CanonPath & path) override;
|
||||
|
||||
std::string readLink(const CanonPath & path) override;
|
||||
|
||||
std::optional<CanonPath> getPhysicalPath(const CanonPath & path) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue