]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debindexfile.h
add d-pointer, virtual destructors and de-inline de/constructors
[apt.git] / apt-pkg / deb / debindexfile.h
CommitLineData
b2e465d6
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
b2e465d6
AL
3/* ######################################################################
4
5 Debian Index Files
6
7 There are three sorts currently
8
9 Package files that have File: tags
10 Package files that don't (/var/lib/dpkg/status)
11 Source files
12
13 ##################################################################### */
14 /*}}}*/
15#ifndef PKGLIB_DEBINDEXFILE_H
16#define PKGLIB_DEBINDEXFILE_H
17
453b82a3
DK
18#include <apt-pkg/indexfile.h>
19#include <apt-pkg/cacheiterators.h>
20#include <apt-pkg/pkgcache.h>
21#include <apt-pkg/srcrecords.h>
13500573 22
453b82a3
DK
23#include <string>
24
25class OpProgress;
26class pkgAcquire;
27class pkgCacheGenerator;
b2e465d6 28
b2e465d6 29
dce45dbe 30class APT_HIDDEN debStatusIndex : public pkgIndexFile
b2e465d6 31{
c8a4ce6c 32 void *d;
6d38011b 33 protected:
8f3ba4e8 34 std::string File;
6d38011b 35
b2e465d6
AL
36 public:
37
a02db58f 38 virtual const Type *GetType() const APT_CONST;
e3c1cfc7 39
b2e465d6 40 // Interface for acquire
65512241 41 virtual std::string Describe(bool /*Short*/) const {return File;};
e3c1cfc7 42
b2e465d6
AL
43 // Interface for the Cache Generator
44 virtual bool Exists() const;
45 virtual bool HasPackages() const {return true;};
46 virtual unsigned long Size() const;
2e5f4e45 47 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
b2e465d6
AL
48 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
49
8f3ba4e8 50 debStatusIndex(std::string File);
862bafea 51 virtual ~debStatusIndex();
b2e465d6 52};
3809194b 53
e3c1cfc7
DK
54class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile
55{
c8a4ce6c 56 void *d;
b2e465d6 57 public:
e3c1cfc7 58
a02db58f 59 virtual const Type *GetType() const APT_CONST;
b2e465d6
AL
60
61 // Stuff for accessing files on remote items
8f3ba4e8 62 virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const;
e3c1cfc7 63
b2e465d6 64 // Interface for the Cache Generator
b2e465d6 65 virtual bool HasPackages() const {return true;};
2e5f4e45 66 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
b2e465d6 67 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
7db98ffc 68
e3c1cfc7 69 debPackagesIndex(IndexTarget const &Target, bool const Trusted);
862bafea 70 virtual ~debPackagesIndex();
b2e465d6
AL
71};
72
e3c1cfc7 73class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile
a52f938b 74{
c8a4ce6c 75 void *d;
a52f938b 76 public:
d38926ef 77
a02db58f 78 virtual const Type *GetType() const APT_CONST;
a52f938b 79
a52f938b 80 // Interface for the Cache Generator
11680bfd 81 virtual bool HasPackages() const;
2e5f4e45 82 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
c51c6f08 83 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
a52f938b 84
e3c1cfc7 85 debTranslationsIndex(IndexTarget const &Target);
862bafea 86 virtual ~debTranslationsIndex();
a52f938b
OS
87};
88
e3c1cfc7 89class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile
b2e465d6 90{
c8a4ce6c 91 void *d;
b2e465d6
AL
92 public:
93
a02db58f 94 virtual const Type *GetType() const APT_CONST;
b2e465d6
AL
95
96 // Stuff for accessing files on remote items
8f3ba4e8 97 virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record,
b2e465d6 98 pkgSrcRecords::File const &File) const;
b2e465d6
AL
99
100 // Interface for the record parsers
101 virtual pkgSrcRecords::Parser *CreateSrcParser() const;
e3c1cfc7 102
b2e465d6 103 // Interface for the Cache Generator
b2e465d6 104 virtual bool HasPackages() const {return false;};
e3c1cfc7
DK
105
106 debSourcesIndex(IndexTarget const &Target, bool const Trusted);
862bafea 107 virtual ~debSourcesIndex();
b2e465d6
AL
108};
109
dce45dbe 110class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile
0d29b9d4
MV
111{
112 private:
113 void *d;
114 std::string DebFile;
115 std::string DebFileFullPath;
116
117 public:
118 virtual const Type *GetType() const APT_CONST;
119
120 virtual std::string Describe(bool /*Short*/) const {
121 return DebFile;
122 }
123
2f6a2fbb
DK
124 /** get the control (file) content of the deb file
125 *
126 * @param[out] content of the control file
127 * @param debfile is the filename of the .deb-file
128 * @return \b true if successful, otherwise \b false.
129 */
130 static bool GetContent(std::ostream &content, std::string const &debfile);
131
0d29b9d4
MV
132 // Interface for the Cache Generator
133 virtual bool Exists() const;
134 virtual bool HasPackages() const {
135 return true;
136 };
137 virtual unsigned long Size() const;
138 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
139 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
140
141 // Interface for acquire
142 virtual std::string ArchiveURI(std::string /*File*/) const;
143
144 debDebPkgFileIndex(std::string DebFile);
862bafea
DK
145 virtual ~debDebPkgFileIndex();
146};
070536e6 147
dce45dbe 148class APT_HIDDEN debDscFileIndex : public pkgIndexFile
a49e7948
MV
149{
150 private:
c8a4ce6c 151 void *d;
a49e7948
MV
152 std::string DscFile;
153 public:
154 virtual const Type *GetType() const APT_CONST;
155 virtual pkgSrcRecords::Parser *CreateSrcParser() const;
156 virtual bool Exists() const;
157 virtual bool HasPackages() const {return false;};
158 virtual unsigned long Size() const;
159 virtual std::string Describe(bool /*Short*/) const {
160 return DscFile;
161 };
162
163 debDscFileIndex(std::string &DscFile);
c8a4ce6c 164 virtual ~debDscFileIndex();
a49e7948
MV
165};
166
dce45dbe 167class APT_HIDDEN debDebianSourceDirIndex : public debDscFileIndex
77da39b9 168{
3809194b 169 public:
77da39b9 170 virtual const Type *GetType() const APT_CONST;
0d29b9d4
MV
171};
172
b2e465d6 173#endif