]> git.saurik.com Git - apt.git/blame - apt-pkg/metaindex.h
* apt-pkg/sourcelist.cc:
[apt.git] / apt-pkg / metaindex.h
CommitLineData
b3d44315
MV
1#ifndef PKGLIB_METAINDEX_H
2#define PKGLIB_METAINDEX_H
3
b3d44315
MV
4
5#include <string>
6#include <apt-pkg/pkgcache.h>
7#include <apt-pkg/srcrecords.h>
8#include <apt-pkg/pkgrecords.h>
9#include <apt-pkg/indexfile.h>
10#include <apt-pkg/vendor.h>
11
12using std::string;
13
14class pkgAcquire;
15class pkgCacheGenerator;
16class OpProgress;
17
18class metaIndex
19{
20 protected:
21 vector <pkgIndexFile *> *Indexes;
22 const char *Type;
23 string URI;
24 string Dist;
25 bool Trusted;
26
27 public:
28
29
30 // Various accessors
31 virtual string GetURI() const {return URI;}
32 virtual string GetDist() const {return Dist;}
33 virtual const char* GetType() const {return Type;}
34
35 // Interface for acquire
5dd4c8b8
DK
36 virtual string ArchiveURI(string const& /*File*/) const = 0;
37 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
b3d44315
MV
38
39 virtual vector<pkgIndexFile *> *GetIndexFiles() = 0;
40 virtual bool IsTrusted() const = 0;
41
7a9f09bd
MV
42 virtual ~metaIndex() {
43 if (Indexes == 0)
44 return;
45 for (vector<pkgIndexFile *>::iterator I = (*Indexes).begin(); I != (*Indexes).end(); ++I)
46 delete *I;
47 delete Indexes;
48 }
b3d44315
MV
49};
50
51#endif