]> git.saurik.com Git - apt.git/blob - apt-pkg/metaindex.h
detect and error out on conflicting Trusted settings
[apt.git] / apt-pkg / metaindex.h
1 #ifndef PKGLIB_METAINDEX_H
2 #define PKGLIB_METAINDEX_H
3
4 #include <apt-pkg/indexfile.h>
5 #include <apt-pkg/init.h>
6
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
17 #ifndef APT_8_CLEANER_HEADERS
18 #include <apt-pkg/srcrecords.h>
19 #include <apt-pkg/pkgrecords.h>
20 #include <apt-pkg/vendor.h>
21 using std::string;
22 #endif
23
24 class pkgAcquire;
25 class IndexTarget;
26 class pkgCacheGenerator;
27 class OpProgress;
28
29 class metaIndex
30 {
31 void * const d;
32 protected:
33 std::vector <pkgIndexFile *> *Indexes;
34 const char *Type;
35 std::string URI;
36 std::string Dist;
37
38 public:
39
40 // Various accessors
41 virtual std::string GetURI() const {return URI;}
42 virtual std::string GetDist() const {return Dist;}
43 virtual const char* GetType() const {return Type;}
44
45 // interface to to query it
46 /** \return the path of the local file (or "" if its not available) */
47 virtual std::string LocalFileName() const;
48
49 // Interface for acquire
50 virtual std::string ArchiveURI(std::string const& File) const = 0;
51 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
52 virtual std::vector<IndexTarget> GetIndexTargets() const = 0;
53 virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0;
54 virtual bool IsTrusted() const = 0;
55
56 virtual std::string Describe() const;
57 virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const;
58 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
59
60 metaIndex(std::string const &URI, std::string const &Dist,
61 char const * const Type);
62 virtual ~metaIndex();
63 };
64
65 #endif