do not pollute namespace in the headers with using (Closes: #500198)
[ntk/apt.git] / apt-pkg / metaindex.h
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
12 class pkgAcquire;
13 class pkgCacheGenerator;
14 class OpProgress;
15
16 class metaIndex
17 {
18 protected:
19 std::vector <pkgIndexFile *> *Indexes;
20 const char *Type;
21 std::string URI;
22 std::string Dist;
23 bool Trusted;
24
25 public:
26
27
28 // Various accessors
29 virtual std::string GetURI() const {return URI;}
30 virtual std::string GetDist() const {return Dist;}
31 virtual const char* GetType() const {return Type;}
32
33 // Interface for acquire
34 virtual std::string ArchiveURI(std::string const& /*File*/) const = 0;
35 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
36
37 virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0;
38 virtual bool IsTrusted() const = 0;
39
40 metaIndex(std::string const &URI, std::string const &Dist, char const * const Type) :
41 Indexes(NULL), Type(Type), URI(URI), Dist(Dist) {
42 }
43
44 virtual ~metaIndex() {
45 if (Indexes == 0)
46 return;
47 for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin(); I != (*Indexes).end(); ++I)
48 delete *I;
49 delete Indexes;
50 }
51 };
52
53 #endif