Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
tarfile.hh File Reference
#include "serialise.hh"
#include "fs-sink.hh"
#include <archive.h>

Go to the source code of this file.

Classes

struct  nix::TarArchive
 

Functions

int nix::getArchiveFilterCodeByName (const std::string &method)
 Get filter_code from its name.
 
void nix::unpackTarfile (Source &source, const std::filesystem::path &destDir)
 
void nix::unpackTarfile (const std::filesystem::path &tarFile, const std::filesystem::path &destDir)
 
time_t nix::unpackTarfileToSink (TarArchive &archive, ExtendedFileSystemObjectSink &parseSink)
 

Function Documentation

◆ getArchiveFilterCodeByName()

int nix::getArchiveFilterCodeByName ( const std::string & method)

Get filter_code from its name.

libarchive does not provide a convenience function like archive_write_add_filter_by_name but for reading. Instead it's necessary to use this kludge to convert method -> code and then use archive_read_support_filter_by_code. Arguably this is better than hand-rolling the equivalent function that is better implemented in libarchive.