]> git.saurik.com Git - apt.git/blame - apt-pkg/metaindex.h
pkgPolicy: Introduce storage and helpers for per-version pins
[apt.git] / apt-pkg / metaindex.h
CommitLineData
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>
14class pkgCacheGenerator;
15class 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
21using std::string;
22#endif
23
b3d44315 24class pkgAcquire;
261727f0 25class IndexTarget;
b07aeb1a
DK
26class pkgCacheGenerator;
27class OpProgress;
b3d44315
MV
28
29class metaIndex
30{
c8a4ce6c 31 void *d;
b3d44315 32 protected:
8f3ba4e8 33 std::vector <pkgIndexFile *> *Indexes;
b3d44315 34 const char *Type;
8f3ba4e8
DK
35 std::string URI;
36 std::string Dist;
b3d44315
MV
37 bool Trusted;
38
39 public:
40
b3d44315 41 // Various accessors
8f3ba4e8
DK
42 virtual std::string GetURI() const {return URI;}
43 virtual std::string GetDist() const {return Dist;}
b3d44315
MV
44 virtual const char* GetType() const {return Type;}
45
7014e148 46 // interface to to query it
f105aaba
DK
47 /** \return the path of the local file (or "" if its not available) */
48 virtual std::string LocalFileName() const;
7014e148 49
b3d44315 50 // Interface for acquire
7014e148 51 virtual std::string ArchiveURI(std::string const& File) const = 0;
5dd4c8b8 52 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
261727f0 53 virtual std::vector<IndexTarget> GetIndexTargets() const = 0;
f105aaba 54 virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0;
b3d44315
MV
55 virtual bool IsTrusted() const = 0;
56
b07aeb1a 57 virtual std::string Describe() const;
3fd89e62 58 virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const;
b07aeb1a
DK
59 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
60
f105aaba
DK
61 metaIndex(std::string const &URI, std::string const &Dist,
62 char const * const Type);
63 virtual ~metaIndex();
b3d44315
MV
64};
65
66#endif