diff options
author | Michael Vogt <mvo@debian.org> | 2010-07-12 13:26:10 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2010-07-12 13:26:10 +0200 |
commit | 2a679f4f71784800b6643b5c4eecb4b11865a439 (patch) | |
tree | c8b5f2967f09a3001becf5fb6ff634d933e171a2 /apt-pkg/contrib/fileutl.h | |
parent | 137a73dc58b14f71a11da5940e099725f6dad8ef (diff) | |
parent | d10cef824604012516f26efaae8bab1f29a7820a (diff) |
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/contrib/fileutl.h')
-rw-r--r-- | apt-pkg/contrib/fileutl.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 528725f89..0f70ab722 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -26,6 +26,8 @@ #include <string> #include <vector> +#include <zlib.h> + using std::string; class FileFd @@ -38,9 +40,10 @@ class FileFd unsigned long Flags; string FileName; string TemporaryFileName; - + gzFile gz; + public: - enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp}; + enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp,ReadOnlyGzip}; inline bool Read(void *To,unsigned long Size,bool AllowEof) { @@ -71,12 +74,12 @@ class FileFd inline string &Name() {return FileName;}; FileFd(string FileName,OpenMode Mode,unsigned long Perms = 0666) : iFd(-1), - Flags(0) + Flags(0), gz(NULL) { Open(FileName,Mode,Perms); }; - FileFd(int Fd = -1) : iFd(Fd), Flags(AutoClose) {}; - FileFd(int Fd,bool) : iFd(Fd), Flags(0) {}; + FileFd(int Fd = -1) : iFd(Fd), Flags(AutoClose), gz(NULL) {}; + FileFd(int Fd,bool) : iFd(Fd), Flags(0), gz(NULL) {}; virtual ~FileFd(); }; |