Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
file-content-address.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/util/source-accessor.hh"
5
6namespace nix {
7
8struct SourcePath;
9
20enum struct FileSerialisationMethod : uint8_t {
28
37};
38
47FileSerialisationMethod parseFileSerialisationMethod(std::string_view input);
48
54std::string_view renderFileSerialisationMethod(FileSerialisationMethod method);
55
59void dumpPath(
60 const SourcePath & path, Sink & sink, FileSerialisationMethod method, PathFilter & filter = defaultPathFilter);
61
62class RestoreSinkHooks;
63
69void restorePath(
70 const std::filesystem::path & path,
71 Source & source,
72 FileSerialisationMethod method,
73 bool startFsync = false,
74 RestoreSinkHooks * hooks = nullptr);
75
86HashResult hashPath(
87 const SourcePath & path, FileSerialisationMethod method, HashAlgorithm ha, PathFilter & filter = defaultPathFilter);
88
96enum struct FileIngestionMethod : uint8_t {
104
112
122};
123
133FileIngestionMethod parseFileIngestionMethod(std::string_view input);
134
140std::string_view renderFileIngestionMethod(FileIngestionMethod method);
141
152std::pair<Hash, std::optional<uint64_t>> hashPath(
153 const SourcePath & path, FileIngestionMethod method, HashAlgorithm ha, PathFilter & filter = defaultPathFilter);
154
155} // namespace nix
FileSerialisationMethod
Definition file-content-address.hh:20
@ Flat
Definition file-content-address.hh:27
@ NixArchive
Definition file-content-address.hh:36
FileIngestionMethod
Definition file-content-address.hh:96
@ Git
Definition file-content-address.hh:121
Definition source-path.hh:22