Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
remote-fs-accessor.hh
Go to the documentation of this file.
1#pragma once
3
4#include "source-accessor.hh"
5#include "ref.hh"
6#include "store-api.hh"
7
8namespace nix {
9
10class RemoteFSAccessor : public SourceAccessor
11{
12 ref<Store> store;
13
14 std::map<std::string, ref<SourceAccessor>> nars;
15
16 bool requireValidPath;
17
18 Path cacheDir;
19
20 std::pair<ref<SourceAccessor>, CanonPath> fetch(const CanonPath & path);
21
22 friend class BinaryCacheStore;
23
24 Path makeCacheFile(std::string_view hashPart, const std::string & ext);
25
26 ref<SourceAccessor> addToCache(std::string_view hashPart, std::string && nar);
27
28public:
29
30 RemoteFSAccessor(ref<Store> store,
31 bool requireValidPath = true,
32 const /* FIXME: use std::optional */ Path & cacheDir = "");
33
34 std::optional<Stat> maybeLstat(const CanonPath & path) override;
35
36 DirEntries readDirectory(const CanonPath & path) override;
37
38 std::string readFile(const CanonPath & path) override;
39
40 std::string readLink(const CanonPath & path) override;
41};
42
43}
Definition canon-path.hh:41
Definition ref.hh:15
std::optional< SourceAccessor::Stat > maybeLstat() const
std::string readFile() const
std::string readLink() const
SourceAccessor::DirEntries readDirectory() const
std::string Path
Definition types.hh:22