aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/tree-info.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-03-30 14:03:28 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-03-30 14:04:53 +0200
commite0a0ae0467fa8cdcc542f593b9d94283f04508ff (patch)
tree9ee49c40c301f51c4f20a0d9ad2031c7de001100 /src/libfetchers/tree-info.hh
parent4ba4c7ff66c95319d98fa859428f60f30f94edd4 (diff)
Move fetchers from libstore to libfetchers
Diffstat (limited to 'src/libfetchers/tree-info.hh')
-rw-r--r--src/libfetchers/tree-info.hh26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libfetchers/tree-info.hh b/src/libfetchers/tree-info.hh
new file mode 100644
index 000000000..02e92759b
--- /dev/null
+++ b/src/libfetchers/tree-info.hh
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "path.hh"
+
+namespace nix { class Store; }
+
+namespace nix::fetchers {
+
+struct TreeInfo
+{
+ Hash narHash;
+ std::optional<uint64_t> revCount;
+ std::optional<time_t> lastModified;
+
+ bool operator ==(const TreeInfo & other) const
+ {
+ return
+ narHash == other.narHash
+ && revCount == other.revCount
+ && lastModified == other.lastModified;
+ }
+
+ StorePath computeStorePath(Store & store) const;
+};
+
+}