diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-05-06 13:42:03 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-05-06 13:42:03 +0200 |
commit | db36c35a351a76825ae00628b74c160bc418683c (patch) | |
tree | b0f31e19e45775f9a0880c0d4801e87077696036 /apt-pkg/dirstream.h | |
parent | 7f0508ecc442705ac9fcbc3c2b5ac74ead18fff8 (diff) | |
parent | 6089a4b17c61ef30b2efc00e270b0907f51f352a (diff) |
Merge branch 'pu/merge-libraries'
Diffstat (limited to 'apt-pkg/dirstream.h')
-rw-r--r-- | apt-pkg/dirstream.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/apt-pkg/dirstream.h b/apt-pkg/dirstream.h new file mode 100644 index 000000000..0f0e348d0 --- /dev/null +++ b/apt-pkg/dirstream.h @@ -0,0 +1,57 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ###################################################################### + + Directory Stream + + When unpacking the contents of the archive are passed into a directory + stream class for analysis and processing. The class controls all aspects + of actually writing the directory stream from disk. The low level + archive handlers are only responsible for decoding the archive format + and sending events (via method calls) to the specified directory + stream. + + When unpacking a real file the archive handler is passed back a file + handle to write the data to, this is to support strange + archives+unpacking methods. If that fd is -1 then the file data is + simply ignored. + + The provided defaults do the 'Right Thing' for a normal unpacking + process (ie 'tar') + + ##################################################################### */ + /*}}}*/ +#ifndef PKGLIB_DIRSTREAM_H +#define PKGLIB_DIRSTREAM_H + +#include <apt-pkg/macros.h> + +class pkgDirStream +{ + public: + + // All possible information about a component + struct Item + { + enum Type_t {File, HardLink, SymbolicLink, CharDevice, BlockDevice, + Directory, FIFO} Type; + char *Name; + char *LinkTarget; + unsigned long Mode; + unsigned long UID; + unsigned long GID; + unsigned long long Size; + unsigned long MTime; + unsigned long Major; + unsigned long Minor; + }; + + virtual bool DoItem(Item &Itm,int &Fd); + virtual bool Fail(Item &Itm,int Fd); + virtual bool FinishedFile(Item &Itm,int Fd); + virtual bool Process(Item &/*Itm*/,const unsigned char * /*Data*/, + unsigned long long /*Size*/,unsigned long long /*Pos*/) {return true;}; + virtual ~pkgDirStream() {}; +}; + +#endif |