about summary refs log tree commit diff
path: root/src/libstore/store-api.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-25T16·43+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-25T16·43+0100
commit1042c10fd0417fe33dd879317f5d7a73aa6f7fe3 (patch)
tree32497b429bf45d6338638ec5f20fdcfc48a56c39 /src/libstore/store-api.hh
parent152b1d6bf9c89b4db9848475e3000821e159d479 (diff)
Add NAR / Store accessor abstraction
This is primary to allow hydra-queue-runner to extract files like
"nix-support/hydra-build-products" from NARs in binary caches.
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r--src/libstore/store-api.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 84ede157e87a..347387f03403 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -140,9 +140,10 @@ struct BuildResult
 
 struct BasicDerivation;
 struct Derivation;
+struct FSAccessor;
 
 
-class Store
+class Store : public std::enable_shared_from_this<Store>
 {
 public:
 
@@ -314,6 +315,9 @@ public:
        remain. */
     virtual bool verifyStore(bool checkContents, bool repair) = 0;
 
+    /* Return an object to access files in the Nix store. */
+    virtual ref<FSAccessor> getFSAccessor() = 0;
+
     /* Utility functions. */
 
     /* Read a derivation, after ensuring its existence through
@@ -345,6 +349,12 @@ public:
 };
 
 
+class LocalFSStore : public Store
+{
+    ref<FSAccessor> getFSAccessor() override;
+};
+
+
 /* !!! These should be part of the store API, I guess. */
 
 /* Throw an exception if `path' is not directly in the Nix store. */