2020-07-27 20:38:59 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "fs-accessor.hh"
|
|
|
|
#include "types.hh"
|
|
|
|
#include "serialise.hh"
|
|
|
|
#include "hash.hh"
|
|
|
|
|
|
|
|
struct NarMemberData
|
|
|
|
{
|
|
|
|
nix::FSAccessor::Type type;
|
2020-08-04 11:34:05 +02:00
|
|
|
std::optional<uint64_t> fileSize;
|
2020-07-27 20:38:59 +02:00
|
|
|
std::optional<std::string> contents;
|
|
|
|
std::optional<nix::Hash> sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::map<nix::Path, NarMemberData> NarMemberDatas;
|
|
|
|
|
|
|
|
/* Read a NAR from a source and get to some info about every file
|
|
|
|
inside the NAR. */
|
|
|
|
void extractNarData(
|
|
|
|
nix::Source & source,
|
|
|
|
const nix::Path & prefix,
|
|
|
|
NarMemberDatas & members);
|