Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
fs-accessor.hh
Go to the documentation of this file.
1#pragma once
3
6#include <kj/async.h>
7
8namespace nix {
9
15{
16public:
17 enum Type { tMissing, tRegular, tSymlink, tDirectory };
18
19 struct Stat
20 {
21 Type type = tMissing;
25 uint64_t fileSize = 0;
29 bool isExecutable = false; // regular files only
33 uint64_t narOffset = 0; // regular files only
34 };
35
36 virtual ~FSAccessor() { }
37
38 virtual kj::Promise<Result<Stat>> stat(const Path & path) = 0;
39
40 virtual kj::Promise<Result<StringSet>> readDirectory(const Path & path) = 0;
41
49 virtual kj::Promise<Result<std::string>>
50 readFile(const Path & path, bool requireValidPath = true) = 0;
51
52 virtual kj::Promise<Result<std::string>> readLink(const Path & path) = 0;
53};
54
55}
Definition fs-accessor.hh:15
virtual kj::Promise< Result< std::string > > readFile(const Path &path, bool requireValidPath=true)=0
Definition fs-accessor.hh:20
uint64_t narOffset
Definition fs-accessor.hh:33
bool isExecutable
Definition fs-accessor.hh:29
uint64_t fileSize
Definition fs-accessor.hh:25
std::string Path
Definition types.hh:28