]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debindexfile.h
better non-virtual metaIndex.LocalFileName() implementation
[apt.git] / apt-pkg / deb / debindexfile.h
CommitLineData
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
26class OpProgress;
27class pkgAcquire;
28class pkgCacheGenerator;
b2e465d6 29
b2e465d6
AL
30
31class 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);
862bafea 55 virtual ~debStatusIndex();
b2e465d6
AL
56};
57
58class 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
3809194b
DK
68 APT_HIDDEN std::string Info(const char *Type) const;
69 APT_HIDDEN std::string IndexFile(const char *Type) const;
70 APT_HIDDEN std::string IndexURI(const char *Type) const;
71
b2e465d6
AL
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");
862bafea 92 virtual ~debPackagesIndex();
b2e465d6
AL
93};
94
a52f938b
OS
95class 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
3809194b
DK
105 APT_HIDDEN std::string Info(const char *Type) const;
106 APT_HIDDEN std::string IndexFile(const char *Type) const;
107 APT_HIDDEN std::string IndexURI(const char *Type) const;
a52f938b 108
3809194b 109 APT_HIDDEN 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
118 // Interface for the Cache Generator
119 virtual bool Exists() const;
11680bfd 120 virtual bool HasPackages() const;
a52f938b 121 virtual unsigned long Size() const;
2e5f4e45 122 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
c51c6f08 123 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
a52f938b 124
8f3ba4e8 125 debTranslationsIndex(std::string URI,std::string Dist,std::string Section, char const * const Language);
862bafea 126 virtual ~debTranslationsIndex();
a52f938b
OS
127};
128
b2e465d6
AL
129class debSourcesIndex : public pkgIndexFile
130{
ff72bd0d
MV
131 /** \brief dpointer placeholder (for later in case we need it) */
132 void *d;
133
8f3ba4e8
DK
134 std::string URI;
135 std::string Dist;
136 std::string Section;
b2e465d6 137
3809194b
DK
138 APT_HIDDEN std::string Info(const char *Type) const;
139 APT_HIDDEN std::string IndexFile(const char *Type) const;
140 APT_HIDDEN std::string IndexURI(const char *Type) const;
141
b2e465d6
AL
142 public:
143
a02db58f 144 virtual const Type *GetType() const APT_CONST;
b2e465d6
AL
145
146 // Stuff for accessing files on remote items
8f3ba4e8 147 virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record,
b2e465d6 148 pkgSrcRecords::File const &File) const;
8f3ba4e8 149 virtual std::string ArchiveURI(std::string File) const {return URI + File;};
b2e465d6
AL
150
151 // Interface for acquire
8f3ba4e8 152 virtual std::string Describe(bool Short) const;
b2e465d6
AL
153
154 // Interface for the record parsers
155 virtual pkgSrcRecords::Parser *CreateSrcParser() const;
156
157 // Interface for the Cache Generator
158 virtual bool Exists() const;
159 virtual bool HasPackages() const {return false;};
160 virtual unsigned long Size() const;
161
8f3ba4e8 162 debSourcesIndex(std::string URI,std::string Dist,std::string Section,bool Trusted);
862bafea 163 virtual ~debSourcesIndex();
b2e465d6
AL
164};
165
0d29b9d4
MV
166class debDebPkgFileIndex : public pkgIndexFile
167{
168 private:
169 void *d;
170 std::string DebFile;
171 std::string DebFileFullPath;
172
173 public:
174 virtual const Type *GetType() const APT_CONST;
175
176 virtual std::string Describe(bool /*Short*/) const {
177 return DebFile;
178 }
179
180 // Interface for the Cache Generator
181 virtual bool Exists() const;
182 virtual bool HasPackages() const {
183 return true;
184 };
185 virtual unsigned long Size() const;
186 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
187 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
188
189 // Interface for acquire
190 virtual std::string ArchiveURI(std::string /*File*/) const;
191
192 debDebPkgFileIndex(std::string DebFile);
862bafea
DK
193 virtual ~debDebPkgFileIndex();
194};
070536e6 195
a49e7948
MV
196class debDscFileIndex : public pkgIndexFile
197{
198 private:
199 std::string DscFile;
200 public:
201 virtual const Type *GetType() const APT_CONST;
202 virtual pkgSrcRecords::Parser *CreateSrcParser() const;
203 virtual bool Exists() const;
204 virtual bool HasPackages() const {return false;};
205 virtual unsigned long Size() const;
206 virtual std::string Describe(bool /*Short*/) const {
207 return DscFile;
208 };
209
210 debDscFileIndex(std::string &DscFile);
211 virtual ~debDscFileIndex() {};
212};
213
77da39b9
MV
214class debDebianSourceDirIndex : public debDscFileIndex
215{
3809194b 216 public:
77da39b9 217 virtual const Type *GetType() const APT_CONST;
0d29b9d4
MV
218};
219
b2e465d6 220#endif