]> git.saurik.com Git - apt.git/blame_incremental - apt-pkg/metaindex.h
fix typos in changelog, make DeEscapeString const, improve description
[apt.git] / apt-pkg / metaindex.h
... / ...
CommitLineData
1#ifndef PKGLIB_METAINDEX_H
2#define PKGLIB_METAINDEX_H
3
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
36 virtual string ArchiveURI(string const& /*File*/) const = 0;
37 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
38
39 virtual vector<pkgIndexFile *> *GetIndexFiles() = 0;
40 virtual bool IsTrusted() const = 0;
41
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 }
49};
50
51#endif