1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 23:28:26 -04:00
nix/src/libutil/tarfile.hh

29 lines
597 B
C++
Raw Normal View History

2019-09-11 07:10:46 -04:00
#include "serialise.hh"
2019-12-10 03:47:38 -05:00
#include <archive.h>
2019-09-11 07:10:46 -04:00
namespace nix {
2019-12-10 03:47:38 -05:00
struct TarArchive {
struct archive * archive;
Source * source;
2019-12-10 03:47:38 -05:00
std::vector<unsigned char> buffer;
void check(int err, const std::string & reason = "failed to extract archive (%s)");
2019-12-10 03:47:38 -05:00
TarArchive(Source & source, bool raw = false);
2019-12-10 03:47:38 -05:00
TarArchive(const Path & path);
2019-12-10 03:47:38 -05:00
// disable copy constructor
TarArchive(const TarArchive &) = delete;
2019-12-10 03:47:38 -05:00
void close();
~TarArchive();
};
void unpackTarfile(Source & source, const Path & destDir);
2019-12-07 10:35:14 -05:00
void unpackTarfile(const Path & tarFile, const Path & destDir);
2019-09-11 07:10:46 -04:00
}