Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nar-accessor.hh File Reference
#include "source-accessor.hh"
#include <functional>
#include <nlohmann/json_fwd.hpp>

Go to the source code of this file.

Typedefs

using nix::GetNarBytes = std::function<std::string(uint64_t, uint64_t)>
 

Functions

ref< SourceAccessornix::makeNarAccessor (std::string &&nar)
 
ref< SourceAccessornix::makeNarAccessor (Source &source)
 
ref< SourceAccessornix::makeLazyNarAccessor (const std::string &listing, GetNarBytes getNarBytes)
 
json nix::listNar (ref< SourceAccessor > accessor, const CanonPath &path, bool recurse)
 

Typedef Documentation

◆ GetNarBytes

using nix::GetNarBytes = std::function<std::string(uint64_t, uint64_t)>

Create a NAR accessor from a NAR listing (in the format produced by listNar()). The callback getNarBytes(offset, length) is used by the readFile() method of the accessor to get the contents of files inside the NAR.

Function Documentation

◆ listNar()

nlohmann::json nix::listNar ( ref< SourceAccessor > accessor,
const CanonPath & path,
bool recurse )

Write a JSON representation of the contents of a NAR (except file contents).

◆ makeNarAccessor()

ref< SourceAccessor > nix::makeNarAccessor ( std::string && nar)

Return an object that provides access to the contents of a NAR file.