aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/store-api.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-15 12:49:01 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-15 15:01:26 +0100
commitd0893725651a7657eab21ec4aad97146d2294c98 (patch)
tree4ec1213f2f8b7892bbd2c10f83ec0366afef16ec /src/libstore/store-api.hh
parent74f954ee6253ce1f934327d6c050fdbdeca8fac2 (diff)
Add function to extract hash part of a store path
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r--src/libstore/store-api.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 888ef3e2a..f6fb6c834 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -339,6 +339,9 @@ public:
};
+const size_t storePathHashLen = 32; // base-32 characters, i.e. 160 bits
+
+
/* !!! These should be part of the store API, I guess. */
/* Throw an exception if `path' is not directly in the Nix store. */
@@ -350,6 +353,9 @@ bool isStorePath(const Path & path);
/* Extract the name part of the given store path. */
string storePathToName(const Path & path);
+/* Extract the hash part of the given store path. */
+string storePathToHash(const Path & path);
+
void checkStoreName(const string & name);