]> git.saurik.com Git - apt.git/blob - cmdline/debfile.h
apt-extracttemplates stuff from debconf
[apt.git] / cmdline / debfile.h
1 #ifndef _debfile_H
2 #define _debfile_H
3
4 #include <apt-pkg/fileutl.h>
5 #include <apt-pkg/pkgcache.h>
6 #include <apt-pkg/dirstream.h>
7
8 class DebFile : public pkgDirStream
9 {
10 const char *ParseDepends(const char *Start,const char *Stop,
11 char *&Package, char *&Ver,
12 unsigned int &Op);
13
14 char *CopyString(const char *start, unsigned int len);
15
16 FileFd File;
17 unsigned long Size;
18 char *Control;
19 unsigned long ControlLen;
20
21 public:
22 DebFile(const char *FileName);
23 ~DebFile();
24 bool DoItem(Item &I, int &fd);
25 bool Process(pkgDirStream::Item &I, const unsigned char *data,
26 unsigned long size, unsigned long pos);
27
28 bool Go();
29 bool ParseInfo();
30
31 static char *GetInstalledVer(const char *package);
32
33 char *Package;
34 char *Version;
35 char *DepVer, *PreDepVer;
36 unsigned int DepOp, PreDepOp;
37
38 char *Config;
39 char *Template;
40
41 static pkgCache *Cache;
42 enum { None, IsControl, IsConfig, IsTemplate } Which;
43 };
44
45 #endif