summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.h
diff options
context:
space:
mode:
authormartin@piware.de <>2010-06-09 14:08:20 +0200
committermartin@piware.de <>2010-06-09 14:08:20 +0200
commita3a03f5d7436c870edac9c0eb92e85e1fcaf6bca (patch)
tree652d78aff1b666164f8a3c1cd0f1f2eb7ab687fb /apt-pkg/contrib/fileutl.h
parent3000cb123abe00418ccc2e388b6f93b76fe5514d (diff)
* apt-pkg/contrib/fileutl.{h,cc}:
- Add support for transparent reading of gzipped files. - Link against zlib (in apt-pkg/makefile) and add zlib build dependency.
Diffstat (limited to 'apt-pkg/contrib/fileutl.h')
-rw-r--r--apt-pkg/contrib/fileutl.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index 85a94898c..9925bbed4 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -25,6 +25,8 @@
#include <string>
#include <vector>
+#include <zlib.h>
+
using std::string;
class FileFd
@@ -36,6 +38,7 @@ class FileFd
HitEof = (1<<3)};
unsigned long Flags;
string FileName;
+ gzFile gz;
public:
enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp};
@@ -69,12 +72,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();
};