]>
Commit | Line | Data |
---|---|---|
b3d44315 MV |
1 | #ifndef PKGLIB_METAINDEX_H |
2 | #define PKGLIB_METAINDEX_H | |
3 | ||
b3d44315 | 4 | #include <apt-pkg/indexfile.h> |
7014e148 | 5 | #include <apt-pkg/init.h> |
b3d44315 | 6 | |
453b82a3 DK |
7 | #include <stddef.h> |
8 | ||
9 | #include <string> | |
10 | #include <vector> | |
11 | ||
12 | #ifndef APT_10_CLEANER_HEADERS | |
13 | #include <apt-pkg/pkgcache.h> | |
14 | class pkgCacheGenerator; | |
15 | class OpProgress; | |
16 | #endif | |
a4f6bdc8 | 17 | #ifndef APT_8_CLEANER_HEADERS |
b9dadc24 DK |
18 | #include <apt-pkg/srcrecords.h> |
19 | #include <apt-pkg/pkgrecords.h> | |
20 | #include <apt-pkg/vendor.h> | |
a4f6bdc8 DK |
21 | using std::string; |
22 | #endif | |
23 | ||
b3d44315 | 24 | class pkgAcquire; |
261727f0 | 25 | class IndexTarget; |
b3d44315 MV |
26 | |
27 | class metaIndex | |
28 | { | |
29 | protected: | |
8f3ba4e8 | 30 | std::vector <pkgIndexFile *> *Indexes; |
b3d44315 | 31 | const char *Type; |
8f3ba4e8 DK |
32 | std::string URI; |
33 | std::string Dist; | |
b3d44315 MV |
34 | bool Trusted; |
35 | ||
36 | public: | |
37 | ||
b3d44315 | 38 | // Various accessors |
8f3ba4e8 DK |
39 | virtual std::string GetURI() const {return URI;} |
40 | virtual std::string GetDist() const {return Dist;} | |
b3d44315 MV |
41 | virtual const char* GetType() const {return Type;} |
42 | ||
7014e148 | 43 | // interface to to query it |
f105aaba DK |
44 | /** \return the path of the local file (or "" if its not available) */ |
45 | virtual std::string LocalFileName() const; | |
7014e148 | 46 | |
b3d44315 | 47 | // Interface for acquire |
7014e148 | 48 | virtual std::string ArchiveURI(std::string const& File) const = 0; |
5dd4c8b8 | 49 | virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0; |
261727f0 | 50 | virtual std::vector<IndexTarget> GetIndexTargets() const = 0; |
f105aaba | 51 | virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0; |
b3d44315 MV |
52 | virtual bool IsTrusted() const = 0; |
53 | ||
f105aaba DK |
54 | metaIndex(std::string const &URI, std::string const &Dist, |
55 | char const * const Type); | |
56 | virtual ~metaIndex(); | |
b3d44315 MV |
57 | }; |
58 | ||
59 | #endif |