![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <string>#include <string_view>#include <optional>#include "nix/util/types.hh"#include "nix/util/serialise.hh"#include "nix/util/hash.hh"#include "nix/util/source-path.hh"#include "nix/util/fs-sink.hh"#include "nix/util/merkle-files.hh"Go to the source code of this file.
Classes | |
| struct | nix::git::LsRemoteRefLine |
| struct | nix::git::TreeEntry |
Typedefs | |
| using | nix::git::Tree = std::map<std::string, TreeEntry> |
| using | nix::git::DumpHook = TreeEntry(const SourcePath & path) |
| using | nix::git::RawMode |
Enumerations | |
| enum struct | ObjectType { Blob , Tree } |
| enum struct | nix::git::Mode |
Functions | |
| std::optional< Mode > | nix::git::decodeMode (RawMode m) |
| ObjectType | nix::git::parseObjectType (Source &source) |
| uint64_t | nix::git::parseBlob (Source &source) |
| void | nix::git::parseTree (merkle::DirectorySink &sink, Source &source, HashAlgorithm hashAlgo) |
| std::optional< Mode > | nix::git::convertMode (SourceAccessor::Type type) |
| void | nix::git::dumpBlobPrefix (uint64_t size, Sink &sink) |
| void | nix::git::dumpTree (const Tree &entries, Sink &sink) |
| Mode | nix::git::dump (const SourcePath &path, Sink &sink, fun< DumpHook > hook, PathFilter &filter) |
| TreeEntry | nix::git::dumpHash (HashAlgorithm ha, const SourcePath &path, PathFilter &filter) |
| std::optional< LsRemoteRefLine > | nix::git::parseLsRemoteLine (std::string_view line) |
| using nix::git::DumpHook = TreeEntry(const SourcePath & path) |
Callback for processing a child with dump
The function should return the Git hash and mode of the file at the given path in the accessor passed to dump.
Note that if the child is a directory, its child in must also be so processed in order to compute this information.
| using nix::git::Tree = std::map<std::string, TreeEntry> |
A Git tree object, fully decoded and stored in memory.
Directory names must end in a / for sake of sorting. See https://github.com/mirage/irmin/issues/352
|
strong |
The mode of a file in a content-addressed/merkle file system. These values match the Git file modes.
| std::optional< Mode > nix::git::convertMode | ( | SourceAccessor::Type | type | ) |
Convert a SourceAccessor::Type to a Mode.
| void nix::git::dumpBlobPrefix | ( | uint64_t | size, |
| Sink & | sink ) |
Dumps a single file to a sink
| TreeEntry nix::git::dumpHash | ( | HashAlgorithm | ha, |
| const SourcePath & | path, | ||
| PathFilter & | filter = defaultPathFilter ) |
Recursively dumps path, hashing as we go.
A smaller wrapper around dump.
Dumps a representation of a git tree to a sink
| uint64_t nix::git::parseBlob | ( | Source & | source | ) |
Read the size of the blob
The caller should then call Source::drainInto or similar with that size.
| std::optional< LsRemoteRefLine > nix::git::parseLsRemoteLine | ( | std::string_view | line | ) |
Parse an LsRemoteRefLine
| ObjectType nix::git::parseObjectType | ( | Source & | source | ) |
Parse the "blob " or "tree " prefix.
| if | prefix not recognized |
| void nix::git::parseTree | ( | merkle::DirectorySink & | sink, |
| Source & | source, | ||
| HashAlgorithm | hashAlgo ) |
| hashAlgo | must be HashAlgo::SHA1 or HashAlgo::SHA256 for now. |