diff options
Diffstat (limited to 'src/libutil/tarfile.hh')
-rw-r--r-- | src/libutil/tarfile.hh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libutil/tarfile.hh b/src/libutil/tarfile.hh index 89a024f1d..4d9141fd4 100644 --- a/src/libutil/tarfile.hh +++ b/src/libutil/tarfile.hh @@ -1,7 +1,26 @@ #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 close(); + + ~TarArchive(); +}; void unpackTarfile(Source & source, const Path & destDir); void unpackTarfile(const Path & tarFile, const Path & destDir); |