summaryrefslogtreecommitdiffstats
path: root/apt-pkg/contrib/extracttar.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
commit76e2632459410dec81337edb6a9fee33c9a660f3 (patch)
treea73345df208eede4a4daad340515c9328f34625c /apt-pkg/contrib/extracttar.h
parentInitial commit. (diff)
downloadapt-76e2632459410dec81337edb6a9fee33c9a660f3.tar.xz
apt-76e2632459410dec81337edb6a9fee33c9a660f3.zip
Adding upstream version 2.7.12.upstream/2.7.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-pkg/contrib/extracttar.h')
-rw-r--r--apt-pkg/contrib/extracttar.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/apt-pkg/contrib/extracttar.h b/apt-pkg/contrib/extracttar.h
new file mode 100644
index 0000000..a3c862a
--- /dev/null
+++ b/apt-pkg/contrib/extracttar.h
@@ -0,0 +1,55 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+/* ######################################################################
+
+ Extract a Tar - Tar Extractor
+
+ The tar extractor takes an ordinary gzip compressed tar stream from
+ the given file and explodes it, passing the individual items to the
+ given Directory Stream for processing.
+
+ ##################################################################### */
+ /*}}}*/
+#ifndef PKGLIB_EXTRACTTAR_H
+#define PKGLIB_EXTRACTTAR_H
+
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/macros.h>
+
+#include <string>
+
+
+class pkgDirStream;
+
+class APT_PUBLIC ExtractTar
+{
+ protected:
+
+ struct TarHeader;
+
+ // The varios types items can be
+ enum ItemType {NormalFile0 = '\0',NormalFile = '0',HardLink = '1',
+ SymbolicLink = '2',CharacterDevice = '3',
+ BlockDevice = '4',Directory = '5',FIFO = '6',
+ GNU_LongLink = 'K',GNU_LongName = 'L'};
+
+ FileFd &File;
+ unsigned long long MaxInSize;
+ int GZPid;
+ FileFd InFd;
+ bool Eof;
+ std::string DecompressProg;
+
+ // Fork and reap gzip
+ bool StartGzip();
+ bool Done();
+
+ public:
+
+ bool Go(pkgDirStream &Stream);
+
+ ExtractTar(FileFd &Fd,unsigned long long Max,std::string DecompressionProgram);
+ virtual ~ExtractTar();
+};
+
+#endif