]>
Commit | Line | Data |
---|---|---|
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> | |
b3d44315 | 7 | #include <apt-pkg/indexfile.h> |
b3d44315 | 8 | |
a4f6bdc8 DK |
9 | #ifndef APT_8_CLEANER_HEADERS |
10 | using std::string; | |
11 | #endif | |
12 | ||
b3d44315 MV |
13 | class pkgAcquire; |
14 | class pkgCacheGenerator; | |
15 | class OpProgress; | |
16 | ||
17 | class metaIndex | |
18 | { | |
19 | protected: | |
8f3ba4e8 | 20 | std::vector <pkgIndexFile *> *Indexes; |
b3d44315 | 21 | const char *Type; |
8f3ba4e8 DK |
22 | std::string URI; |
23 | std::string Dist; | |
b3d44315 MV |
24 | bool Trusted; |
25 | ||
26 | public: | |
27 | ||
28 | ||
29 | // Various accessors | |
8f3ba4e8 DK |
30 | virtual std::string GetURI() const {return URI;} |
31 | virtual std::string GetDist() const {return Dist;} | |
b3d44315 MV |
32 | virtual const char* GetType() const {return Type;} |
33 | ||
34 | // Interface for acquire | |
8f3ba4e8 | 35 | virtual std::string ArchiveURI(std::string const& /*File*/) const = 0; |
5dd4c8b8 | 36 | virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0; |
b3d44315 | 37 | |
8f3ba4e8 | 38 | virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0; |
b3d44315 MV |
39 | virtual bool IsTrusted() const = 0; |
40 | ||
8f3ba4e8 | 41 | metaIndex(std::string const &URI, std::string const &Dist, char const * const Type) : |
4b42f43b DK |
42 | Indexes(NULL), Type(Type), URI(URI), Dist(Dist) { |
43 | } | |
44 | ||
7a9f09bd MV |
45 | virtual ~metaIndex() { |
46 | if (Indexes == 0) | |
47 | return; | |
8f3ba4e8 | 48 | for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin(); I != (*Indexes).end(); ++I) |
7a9f09bd MV |
49 | delete *I; |
50 | delete Indexes; | |
51 | } | |
b3d44315 MV |
52 | }; |
53 | ||
54 | #endif |