mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 18:26:16 +02:00
35 lines
789 B
C++
35 lines
789 B
C++
|
#pragma once
|
||
|
|
||
|
#include "source-accessor.hh"
|
||
|
|
||
|
namespace nix {
|
||
|
|
||
|
/**
|
||
|
* 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;
|
||
|
|
||
|
void readFile(
|
||
|
const CanonPath & path,
|
||
|
Sink & sink,
|
||
|
std::function<void(uint64_t)> sizeCallback) 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;
|
||
|
};
|
||
|
|
||
|
}
|