]>
Commit | Line | Data |
---|---|---|
b2e465d6 AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
7db98ffc | 3 | // $Id: debindexfile.h,v 1.3.2.1 2003/12/24 23:09:17 mdz Exp $ |
b2e465d6 AL |
4 | /* ###################################################################### |
5 | ||
6 | Debian Index Files | |
7 | ||
8 | There are three sorts currently | |
9 | ||
10 | Package files that have File: tags | |
11 | Package files that don't (/var/lib/dpkg/status) | |
12 | Source files | |
13 | ||
14 | ##################################################################### */ | |
15 | /*}}}*/ | |
16 | #ifndef PKGLIB_DEBINDEXFILE_H | |
17 | #define PKGLIB_DEBINDEXFILE_H | |
18 | ||
453b82a3 DK |
19 | #include <apt-pkg/indexfile.h> |
20 | #include <apt-pkg/cacheiterators.h> | |
21 | #include <apt-pkg/pkgcache.h> | |
22 | #include <apt-pkg/srcrecords.h> | |
13500573 | 23 | |
453b82a3 DK |
24 | #include <string> |
25 | ||
26 | class OpProgress; | |
27 | class pkgAcquire; | |
28 | class pkgCacheGenerator; | |
b2e465d6 | 29 | |
b2e465d6 AL |
30 | |
31 | class debStatusIndex : public pkgIndexFile | |
32 | { | |
ff72bd0d MV |
33 | /** \brief dpointer placeholder (for later in case we need it) */ |
34 | void *d; | |
36b8ebbb | 35 | |
6d38011b | 36 | protected: |
8f3ba4e8 | 37 | std::string File; |
6d38011b | 38 | |
b2e465d6 AL |
39 | public: |
40 | ||
a02db58f | 41 | virtual const Type *GetType() const APT_CONST; |
b2e465d6 AL |
42 | |
43 | // Interface for acquire | |
65512241 | 44 | virtual std::string Describe(bool /*Short*/) const {return File;}; |
b2e465d6 AL |
45 | |
46 | // Interface for the Cache Generator | |
47 | virtual bool Exists() const; | |
48 | virtual bool HasPackages() const {return true;}; | |
49 | virtual unsigned long Size() const; | |
2e5f4e45 | 50 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
6d38011b | 51 | bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog, unsigned long const Flag) const; |
b2e465d6 AL |
52 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
53 | ||
8f3ba4e8 | 54 | debStatusIndex(std::string File); |
ff72bd0d | 55 | virtual ~debStatusIndex() {}; |
b2e465d6 AL |
56 | }; |
57 | ||
58 | class debPackagesIndex : public pkgIndexFile | |
59 | { | |
ff72bd0d MV |
60 | /** \brief dpointer placeholder (for later in case we need it) */ |
61 | void *d; | |
62 | ||
8f3ba4e8 DK |
63 | std::string URI; |
64 | std::string Dist; | |
65 | std::string Section; | |
66 | std::string Architecture; | |
7db98ffc | 67 | |
8f3ba4e8 DK |
68 | std::string Info(const char *Type) const; |
69 | std::string IndexFile(const char *Type) const; | |
70 | std::string IndexURI(const char *Type) const; | |
b2e465d6 AL |
71 | |
72 | public: | |
73 | ||
a02db58f | 74 | virtual const Type *GetType() const APT_CONST; |
b2e465d6 AL |
75 | |
76 | // Stuff for accessing files on remote items | |
8f3ba4e8 DK |
77 | virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const; |
78 | virtual std::string ArchiveURI(std::string File) const {return URI + File;}; | |
b2e465d6 AL |
79 | |
80 | // Interface for acquire | |
8f3ba4e8 | 81 | virtual std::string Describe(bool Short) const; |
b2e465d6 AL |
82 | |
83 | // Interface for the Cache Generator | |
84 | virtual bool Exists() const; | |
85 | virtual bool HasPackages() const {return true;}; | |
86 | virtual unsigned long Size() const; | |
2e5f4e45 | 87 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
b2e465d6 | 88 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
7db98ffc | 89 | |
8f3ba4e8 DK |
90 | debPackagesIndex(std::string const &URI, std::string const &Dist, std::string const &Section, |
91 | bool const &Trusted, std::string const &Arch = "native"); | |
ff72bd0d | 92 | virtual ~debPackagesIndex() {}; |
b2e465d6 AL |
93 | }; |
94 | ||
a52f938b OS |
95 | class debTranslationsIndex : public pkgIndexFile |
96 | { | |
ff72bd0d MV |
97 | /** \brief dpointer placeholder (for later in case we need it) */ |
98 | void *d; | |
99 | ||
8f3ba4e8 DK |
100 | std::string URI; |
101 | std::string Dist; | |
102 | std::string Section; | |
45df0ad2 | 103 | const char * const Language; |
a52f938b | 104 | |
8f3ba4e8 DK |
105 | std::string Info(const char *Type) const; |
106 | std::string IndexFile(const char *Type) const; | |
107 | std::string IndexURI(const char *Type) const; | |
a52f938b | 108 | |
8f3ba4e8 | 109 | inline std::string TranslationFile() const {return std::string("Translation-").append(Language);}; |
a52f938b OS |
110 | |
111 | public: | |
112 | ||
a02db58f | 113 | virtual const Type *GetType() const APT_CONST; |
a52f938b OS |
114 | |
115 | // Interface for acquire | |
8f3ba4e8 | 116 | virtual std::string Describe(bool Short) const; |
a52f938b OS |
117 | virtual bool GetIndexes(pkgAcquire *Owner) const; |
118 | ||
119 | // Interface for the Cache Generator | |
120 | virtual bool Exists() const; | |
11680bfd | 121 | virtual bool HasPackages() const; |
a52f938b | 122 | virtual unsigned long Size() const; |
2e5f4e45 | 123 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
c51c6f08 | 124 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
a52f938b | 125 | |
8f3ba4e8 | 126 | debTranslationsIndex(std::string URI,std::string Dist,std::string Section, char const * const Language); |
ff72bd0d | 127 | virtual ~debTranslationsIndex() {}; |
a52f938b OS |
128 | }; |
129 | ||
b2e465d6 AL |
130 | class debSourcesIndex : public pkgIndexFile |
131 | { | |
ff72bd0d MV |
132 | /** \brief dpointer placeholder (for later in case we need it) */ |
133 | void *d; | |
134 | ||
8f3ba4e8 DK |
135 | std::string URI; |
136 | std::string Dist; | |
137 | std::string Section; | |
b2e465d6 | 138 | |
8f3ba4e8 DK |
139 | std::string Info(const char *Type) const; |
140 | std::string IndexFile(const char *Type) const; | |
141 | std::string IndexURI(const char *Type) const; | |
b2e465d6 AL |
142 | |
143 | public: | |
144 | ||
a02db58f | 145 | virtual const Type *GetType() const APT_CONST; |
b2e465d6 AL |
146 | |
147 | // Stuff for accessing files on remote items | |
8f3ba4e8 | 148 | virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, |
b2e465d6 | 149 | pkgSrcRecords::File const &File) const; |
8f3ba4e8 | 150 | virtual std::string ArchiveURI(std::string File) const {return URI + File;}; |
b2e465d6 AL |
151 | |
152 | // Interface for acquire | |
8f3ba4e8 | 153 | virtual std::string Describe(bool Short) const; |
b2e465d6 AL |
154 | |
155 | // Interface for the record parsers | |
156 | virtual pkgSrcRecords::Parser *CreateSrcParser() const; | |
157 | ||
158 | // Interface for the Cache Generator | |
159 | virtual bool Exists() const; | |
160 | virtual bool HasPackages() const {return false;}; | |
161 | virtual unsigned long Size() const; | |
162 | ||
8f3ba4e8 | 163 | debSourcesIndex(std::string URI,std::string Dist,std::string Section,bool Trusted); |
ff72bd0d | 164 | virtual ~debSourcesIndex() {}; |
b2e465d6 AL |
165 | }; |
166 | ||
0d29b9d4 MV |
167 | class debDebPkgFileIndex : public pkgIndexFile |
168 | { | |
169 | private: | |
170 | void *d; | |
171 | std::string DebFile; | |
172 | std::string DebFileFullPath; | |
173 | ||
174 | public: | |
175 | virtual const Type *GetType() const APT_CONST; | |
176 | ||
177 | virtual std::string Describe(bool /*Short*/) const { | |
178 | return DebFile; | |
179 | } | |
180 | ||
181 | // Interface for the Cache Generator | |
182 | virtual bool Exists() const; | |
183 | virtual bool HasPackages() const { | |
184 | return true; | |
185 | }; | |
186 | virtual unsigned long Size() const; | |
187 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; | |
188 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; | |
189 | ||
190 | // Interface for acquire | |
191 | virtual std::string ArchiveURI(std::string /*File*/) const; | |
192 | ||
193 | debDebPkgFileIndex(std::string DebFile); | |
194 | virtual ~debDebPkgFileIndex() {}; | |
195 | ||
196 | }; | |
197 | ||
b2e465d6 | 198 | #endif |