diff options
Diffstat (limited to 'src/libstore/file-hash.hh')
-rw-r--r-- | src/libstore/file-hash.hh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstore/file-hash.hh b/src/libstore/file-hash.hh index 9d2b78688..e33878bf9 100644 --- a/src/libstore/file-hash.hh +++ b/src/libstore/file-hash.hh @@ -10,6 +10,10 @@ enum struct FileIngestionMethod : uint8_t { Recursive = true }; +struct TextHash { + Hash hash; +}; + /// Pair of a hash, and how the file system was ingested struct FileSystemHash { FileIngestionMethod method; @@ -36,7 +40,7 @@ struct FileSystemHash { makeFixedOutputPath() / addToStore(). */ typedef std::variant< - Hash, // for paths computed by makeTextPath() / addTextToStore + TextHash, // for paths computed by makeTextPath() / addTextToStore FileSystemHash // for path computed by makeFixedOutputPath > ContentAddress; @@ -48,4 +52,8 @@ std::string makeFileIngestionPrefix(const FileIngestionMethod m); for paths created by makeFixedOutputPath() / addToStore(). */ std::string makeFixedOutputCA(FileIngestionMethod method, const Hash & hash); +std::string renderContentAddress(ContentAddress ca); + +std::string renderContentAddress(std::optional<ContentAddress> ca); + } |