mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
31 lines
616 B
C++
31 lines
616 B
C++
#include "serialise.hh"
|
|
#include <archive.h>
|
|
|
|
namespace nix {
|
|
|
|
struct TarArchive {
|
|
struct archive * archive;
|
|
Source * source;
|
|
std::vector<unsigned char> buffer;
|
|
|
|
void check(int err, const std::string & reason = "failed to extract archive (%s)");
|
|
|
|
TarArchive(Source & source, bool raw = false);
|
|
|
|
TarArchive(const Path & path);
|
|
|
|
// disable copy constructor
|
|
TarArchive(const TarArchive &) = delete;
|
|
|
|
void init();
|
|
|
|
void close();
|
|
|
|
~TarArchive();
|
|
};
|
|
|
|
void unpackTarfile(Source & source, const Path & destDir);
|
|
|
|
void unpackTarfile(const Path & tarFile, const Path & destDir);
|
|
|
|
}
|