]>
Commit | Line | Data |
---|---|---|
b3d44315 MV |
1 | #ifndef PKGLIB_DEBMETAINDEX_H |
2 | #define PKGLIB_DEBMETAINDEX_H | |
3 | ||
b3d44315 | 4 | #include <apt-pkg/metaindex.h> |
453b82a3 | 5 | #include <apt-pkg/macros.h> |
b3d44315 | 6 | |
5dd4c8b8 | 7 | #include <map> |
472ff00e DK |
8 | #include <string> |
9 | #include <vector> | |
5dd4c8b8 | 10 | |
b9dadc24 DK |
11 | #ifndef APT_8_CLEANER_HEADERS |
12 | #include <apt-pkg/sourcelist.h> | |
13 | #endif | |
453b82a3 DK |
14 | #ifndef APT_10_CLEANER_HEADERS |
15 | #include <apt-pkg/init.h> | |
16 | #endif | |
17 | ||
18 | class pkgAcquire; | |
19 | class pkgIndexFile; | |
0d29b9d4 | 20 | class debDebPkgFileIndex; |
80624be7 | 21 | class IndexTarget; |
b07aeb1a DK |
22 | class pkgCacheGenerator; |
23 | class OpProgress; | |
463c8d80 | 24 | class debReleaseIndexPrivate; |
b9dadc24 | 25 | |
463c8d80 DK |
26 | class APT_HIDDEN debReleaseIndex : public metaIndex |
27 | { | |
28 | debReleaseIndexPrivate * const d; | |
b3d44315 | 29 | |
3809194b | 30 | enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; |
b3d44315 MV |
31 | |
32 | public: | |
33 | ||
463c8d80 DK |
34 | APT_HIDDEN std::string MetaIndexInfo(const char *Type) const; |
35 | APT_HIDDEN std::string MetaIndexFile(const char *Types) const; | |
36 | APT_HIDDEN std::string MetaIndexURI(const char *Type) const; | |
37 | ||
472ff00e DK |
38 | debReleaseIndex(std::string const &URI, std::string const &Dist); |
39 | debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); | |
ff72bd0d | 40 | virtual ~debReleaseIndex(); |
b3d44315 | 41 | |
472ff00e | 42 | virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; |
5dd4c8b8 | 43 | virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; |
261727f0 | 44 | virtual std::vector<IndexTarget> GetIndexTargets() const; |
7014e148 | 45 | |
b07aeb1a | 46 | virtual std::string Describe() const; |
3fd89e62 | 47 | virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; |
b07aeb1a DK |
48 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
49 | ||
463c8d80 | 50 | virtual std::string LocalFileName() const; |
7014e148 | 51 | |
472ff00e | 52 | virtual std::vector <pkgIndexFile *> *GetIndexFiles(); |
b3d44315 | 53 | |
4b42f43b | 54 | void SetTrusted(bool const Trusted); |
b3d44315 MV |
55 | virtual bool IsTrusted() const; |
56 | ||
463c8d80 DK |
57 | void AddComponent(bool const isSrc, std::string const &Name, |
58 | std::vector<std::string> const &Targets, | |
59 | std::vector<std::string> const &Architectures, | |
60 | std::vector<std::string> Languages); | |
b3d44315 MV |
61 | }; |
62 | ||
dce45dbe | 63 | class APT_HIDDEN debDebFileMetaIndex : public metaIndex |
0d29b9d4 MV |
64 | { |
65 | private: | |
6c55f07a | 66 | void * const d; |
0d29b9d4 MV |
67 | std::string DebFile; |
68 | debDebPkgFileIndex *DebIndex; | |
69 | public: | |
70 | virtual std::string ArchiveURI(std::string const& /*File*/) const { | |
71 | return DebFile; | |
72 | } | |
73 | virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) const { | |
74 | return true; | |
75 | } | |
261727f0 DK |
76 | virtual std::vector<IndexTarget> GetIndexTargets() const { |
77 | return std::vector<IndexTarget>(); | |
78 | } | |
0d29b9d4 MV |
79 | virtual std::vector<pkgIndexFile *> *GetIndexFiles() { |
80 | return Indexes; | |
81 | } | |
82 | virtual bool IsTrusted() const { | |
83 | return true; | |
84 | } | |
85 | debDebFileMetaIndex(std::string const &DebFile); | |
c8a4ce6c | 86 | virtual ~debDebFileMetaIndex(); |
0d29b9d4 MV |
87 | |
88 | }; | |
89 | ||
b3d44315 | 90 | #endif |