aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/content-address.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/content-address.hh')
-rw-r--r--src/libstore/content-address.hh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libstore/content-address.hh b/src/libstore/content-address.hh
index 22a039242..f6a6f5140 100644
--- a/src/libstore/content-address.hh
+++ b/src/libstore/content-address.hh
@@ -55,4 +55,23 @@ std::optional<ContentAddress> parseContentAddressOpt(std::string_view rawCaOpt);
Hash getContentAddressHash(const ContentAddress & ca);
+/*
+ We only have one way to hash text with references, so this is single-value
+ type is only useful in std::variant.
+*/
+struct TextHashMethod { };
+struct FixedOutputHashMethod {
+ FileIngestionMethod fileIngestionMethod;
+ HashType hashType;
+};
+
+typedef std::variant<
+ TextHashMethod,
+ FixedOutputHashMethod
+ > ContentAddressMethod;
+
+ContentAddressMethod parseContentAddressMethod(std::string_view rawCaMethod);
+
+std::string renderContentAddressMethod(ContentAddressMethod caMethod);
+
}